8086 programming multiplication

Discussion in 'Programmer's Corner' started by Rougherunshore, Jul 13, 2013.

  1. Rougherunshore

    Thread Starter New Member

    Feb 24, 2013
    3
    0
    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?
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,715
    4,788
    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.
     
  3. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,669
    804
    I am not sure I get what youre asking. F000* EB5 = DC9 B000
    So Dx becomes DC9 and Ax becomes B000.
     
  4. WBahn

    Moderator

    Mar 31, 2012
    17,715
    4,788
    I think he is thinking that the prior contents of Dx have an effect on the new values.
     
  5. FlyBD5

    New Member

    Jul 15, 2013
    2
    0
    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.
     
  6. Shear_Intelligence

    New Member

    Jun 10, 2012
    29
    0
    DX gets replaced with the new value :)
     
Loading...