How Do ya convert 2 WORDS to a DWORD????? :evil:
Posted on 2004-12-03 03:29:48 by Retsim_X
mov ax, bx

shl eax, 16
mov ax, cx
Posted on 2004-12-03 04:27:31 by Scorpie
If size is of importance you could also do (using the same registers as the above post):



push bx
push cx
pop eax
Posted on 2004-12-07 11:04:47 by nohaven
what size advantage does your methode give? you mean of the compiled code?
Posted on 2004-12-07 14:20:28 by Scorpie
Yeah, compiled code.

00000000  6653              push bx

00000002 6651 push cx
00000004 58 pop eax


vs.

00000000  6689D8            mov ax,bx

00000003 C1E010 shl eax,0x10
00000006 6689C8 mov ax,cx


If you're concerned about size (which I imagine the OP probably isn't), then you save four bytes. It's certainly a hack (the code you provided is the correct way to do it), but may be useful to consider.
Posted on 2004-12-07 14:29:30 by nohaven
Oops, never mind... :oops:
Posted on 2004-12-07 15:03:10 by S/390