assembly multiplication

Discussion in 'Programmer's Corner' started by abuarab88, Mar 27, 2010.

  1. abuarab88

    Thread Starter Member

    Nov 6, 2008
    19
    0
    hey all,

    how can i multiply and divide two 32-bit numbers using 16-bit registers in assembly

    any ideas.
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
  3. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Eh? Floating point math is then far more complex than the original fixed point..

    Have a look at these links for some examples of coding integer math routines.
    http://www.sxlist.com/techref/microchip/math/32bmath-ph.htm
    http://www.piclist.com/techref/microchip/math/index.htm

    Multiplication is a basically a shift-and-add sequence, division is a shift-and-subtract-if-you-can sequence.

    Start off with writing 32 bit add & subtract, using two 16 bit operations with carry/borrow between the stages then work up from that.
     
Loading...