ack/mach/z80/libem/mli2.s

35 lines
365 B
ArmAsm
Raw Permalink Normal View History

1985-03-29 21:44:50 +00:00
.define .mli2
1987-02-02 13:30:20 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1985-03-29 21:44:50 +00:00
! 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