ack/mach/z80/libem/mli2.s
1985-03-29 21:44:50 +00:00

30 lines
307 B
ArmAsm

.define .mli2
! 16 bit multiply
! parameters:
! bc: multiplicand
! de: multiplier
! hl: result (out)
! multiplier (bc) is left unchanged
! no detection of overflow
.mli2:
ld hl,0
ld a,16
0:
bit 7,d
jr z,1f
add hl,bc
1:
dec a
jr z,2f
ex de,hl
add hl,hl
ex de,hl
add hl,hl
jr 0b
2:
ret