home *** CD-ROM | disk | FTP | other *** search
-
- ;++++++++++++++++++++++++++++++++++++++++++++++
- ;
- ; 8 BIT BY 16 BIT MULTIPLY WITH 16 BIT RESULT
- ;
- ; MPY8.LIB - VERSION 0.1 - 12 SEP 77
- ;
- ; J.W. SHOOK, P.O. BOX 185, ROCKY POINT, NY 11778
- ;
- ;++++++++++++++++++++++++++++++++++++++++++++++
-
- ; CALL WITH:
- ; A = Multiplier(unsigned)
- ; DE = Multiplicand(unsigned)
-
- ; RETURN WITH:
- ; HL = Product
-
- MPY8: LXI H,0 ; Clear product reg
- MPY81: ORA A ; Test multiplier
- RZ ; Return if done
- RAR ; Shift LSB into carry
- JNC MPY82 ; Skip if LSB was zero
- DAD D ; Add multiplicand to product
- MPY82: XCHG ; Shift multiplicand left
- DAD H
- XCHG
- JMP MPY81 ; Do next bit of multiplier
-
-