home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG008.ARK
/
MPY8.LIB
< prev
next >
Wrap
Text File
|
1984-04-29
|
652b
|
30 lines
;++++++++++++++++++++++++++++++++++++++++++++++
;
; 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