ack/mach/z80/libem/los.s

37 lines
607 B
ArmAsm
Raw Normal View History

1985-03-29 21:44:50 +00:00
.define .los
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
.los:
pop ix ! save return address
pop de ! number of bytes to transfer
pop hl ! address of lowest byte
add hl,de
dec hl ! address of highest byte
srl d ! divide de by 2
rr e
jr nc,1f ! see if de was odd
ld a,e ! yes, then it must be 1
or d
jr nz,.trp.z ! no, error
ld e,(hl) ! pack 1 byte into integer
push de
jp (ix) ! return
1:
ld b,(hl) ! get 2 bytes
dec hl
ld c,(hl)
dec hl
push bc ! put them on stack, most
! significant byte first
dec de
ld a,d
or e
jr nz,1b ! done ?
jp (ix) ! yes, return