ack/mach/z80/libem/mli2.s
1987-02-02 13:30:20 +00:00

35 lines
365 B
ArmAsm

.define .mli2
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! 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