home *** CD-ROM | disk | FTP | other *** search
/ Der Mediaplex Sampler - Die 6 von Plex / 6_v_plex.zip / 6_v_plex / DISK3 / DFUE_100 / FAMITXT.ZIP / MULT.TXT < prev    next >
Internet Message Format  |  1994-02-07  |  2KB

  1. From:     vic@physci.psu.edu (Vic Ricker)
  2. To:       "Super Famicom Development Group" <famidev@busop.cit.wayne.edu>
  3. Subject:  Re: Multiplying/Dividing?
  4. Date:     Sun, 26 Dec 93 16:29:09 EST
  5. Reply-to: famidev@busop.cit.wayne.edu
  6. Sender:   Listserv@busop.cit.wayne.edu
  7. X-Mailer: Mercury MTA v1.0.
  8.  
  9. Take a look at this:
  10.  
  11.  
  12.     Address: $4202/$4203
  13.        Name: WRMPYA/WRMPYB
  14. Description: Multiplier and multiplicand
  15.  
  16.  
  17.   D7   D6   D5   D4   D3   D2   D1   D0
  18.  
  19. |           MULTIPLICAND-A              |       $4202
  20. |_______________________________________|
  21.  
  22.   D7   D6   D5   D4   D3   D2   D1   D0
  23.  
  24. |            MULTIPLIER-B               |       $4203
  25. |_______________________________________|
  26.  
  27.  
  28. These registers perform absolute multiplication by multiplying
  29. multiplicand A by multiplier B and return product C which can be read
  30. from $4216/$4217 RDMPY.
  31.  
  32. Set register A, then B.  After the B register is set, it will take 8
  33. machine cycles for the multiplication to be completed.
  34.  
  35. * The A register will not be destroyed by the multiplication process.
  36. ^^^ does not refer to the accumulator. it means the multiplicand
  37.  
  38. Also, there is 8/16 multiply that shares the mode 7 matrix registers:
  39. set 16 bit multiplier to $211b and 8 bit multiplicand to $211c the 24
  40. bit product will be placed in $2134-$2136.
  41.  
  42. The shift-add routine is a great way to multiply.  I'm suprised that
  43. so many so-called assembly programmers don't know how to do it.
  44. Regardless of how fast it is, the hardware stuff blows it away.
  45.  
  46. There is also a hardware divide:
  47.  
  48. $4204/4205 is the 16 bit dividend, $4206 is the 8bit divisor, the
  49. quotient will be put in $4214, and the remainder in $4216/4217.
  50.  
  51. ANy questions, lemme know.
  52.