newbie: MUL product
- From: Brian <stringchopperREMOVEALLCAPS@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 29 Mar 2007 10:35:52 -0400
I posted this at CLAX, but it wasn't showing up, so I'll try here.
Hello,
I'm a newbie using MASM on a P4 Intel processor. My tutorial says
that if I multiply AX by a 16 bit register or memory operand, the
product is DX:AX. How do I reference DX:AX if I want to store the
product in memory or to a 32 bit register? I tried "mov ebx, dx:ax"
but that doesn't work.
I can put the value in edx like this:
shl edx, 16
mov dx, ax
but I'm not sure if there is a simpler way, or a way to get to the
32-bit product with just one instruction.
Many thanks for your input!
TITLE MULPract (mul.asm)
INCLUDE Irvine32.inc
..data
val1 WORD 2000h
val2 WORD 0100h
..code
main PROC
mov ax, val1
mul val2
;mov ebx, dx:ax ;<== doesn't work
shl edx, 16 ;<== this works but requires 2 instructions
mov dx, ax ; --- shl then mov
exit
main ENDP
END main
--
thanks,
Brian
To the best of my knowledge, I have:
1) asked a question specifically related to this newsgroup
2) not used my email to request answers be sent there
3) not top-posted
4) not used bad grammar that would make me appear more stupider
.
- Follow-Ups:
- Re: newbie: MUL product
- From: Wolfgang Kern
- Re: newbie: MUL product
- From: Herbert Kleebauer
- Re: newbie: MUL product
- Prev by Date: Re: Ten years later
- Next by Date: Re: OT: Re: Ten years later
- Previous by thread: signed unsiged add instruction
- Next by thread: Re: newbie: MUL product
- Index(es):
Relevant Pages
|