Make your own free website on Tripod.com

MPY88      LD   BC,(MPRAD)      LOAD MULTIPLIER INTO C
           LD   B,8             B IS BIT COUNTER
           LD   DE,(MPDAD)      LOAD MULTIPLICAND INTO E
           LD   D,0             CLEAR D
           LD   HL,0            SET RESULT TO 0
MULT       SRL  C               SHIFT MULTIPLIER INTO CARRY
           JR   NC,NOADD        TEST CARRY
           ADD  HL,DE           ADD MPD TO RESULT
NOADD      SLA  E               SHIFT MPD LEFT
           RL   D               SAVE BIT IN D
           DEC  B               DECREMENT SHIFT COUNTER
           JP   NZ,MULT         DO IT AGAIN IF COUNTER <> 0
           LD   (RESAD),HL      STORE RESULT