8086 programming multiplication

Thread Starter

Rougherunshore

Joined Feb 24, 2013
3
Does anyone know how to multiply 16-bit by 16-bit in 8086 programming. what I currently know is that for example...

Ax= F000 Bx =9015 Dx= 0000

Mul Bx this result will come up to be F000 * 9015 = 8713B000

the the upper half (8713) will be stored in Dx, while the lower half (B000) will

be stored in Ax. My question is what if Dx has a given number let say

Dx = EB5.

what should be the answer?
 

WBahn

Joined Mar 31, 2012
30,056
Let's say that you take your calculator and store the result of multiplying 6 and 4 in the memory. What value will be stored there is the memory previously had the value 20 stored in it?

Same idea applies here.
 

FlyBD5

Joined Jul 15, 2013
2
Does anyone know how to multiply 16-bit by 16-bit in 8086 programming. what I currently know is that for example...

Ax= F000 Bx =9015 Dx= 0000

Mul Bx this result will come up to be F000 * 9015 = 8713B000

the the upper half (8713) will be stored in Dx, while the lower half (B000) will

be stored in Ax. My question is what if Dx has a given number let say

Dx = EB5.

what should be the answer?
Whatever is in DX gets blown away. If you need to keep it push it onto the stack, pop it when you need to recall it. Pay attention to OF and CF as well when the MUL instruction runs.
 
Top