Sign in to follow this  
Doctor Shinobi

[Assembly 8086] IMUL

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

i don't get it. how do i calculate the result of IMUL? can anyone instruct me?
thanks in advance :)

Share this post

Link to post
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:

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 this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this