[Assembly 8086] IMUL

This topic is 2809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

hey :) i have a little problem with assembly 8086.
i need to make a signed multiplication between 150 and 200 without using a program. now expected it to be 30,000 yet i get 5936,which is completely different.

MOV AX, 150
MOV BX, 200
IMUL BL

i don't get it. how do i calculate the result of IMUL? can anyone instruct me?

Share on other sites
Random reference.

IMUL BL implies r/m8, or it multiplies 8-bit value in AL with 8-bit value in BL.

Registers use two's completent representation.
Now, AL is signed, so 150 (10010110b) = - 106
BL is signed as well, so 200 (11001000b) = -56

Multiplying these two means -106 * -56 = 5936, stored in AX.

The solution is obviously:
IMUL BX

This will put result into DX:AX. Since result will be small enough to fit into 16 bits, it will be entirely in AX.

Share on other sites
oh i see now! thanks a lot :D

• 11
• 20
• 12
• 10
• 38
• Forum Statistics

• Total Topics
631400
• Total Posts
2999862
×