ack/mach/z8000/libem/cii.s

30 lines
422 B
ArmAsm
Raw Permalink Normal View History

1985-01-08 11:48:43 +00:00
.define cii
1987-01-19 10:51:50 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1985-01-08 11:48:43 +00:00
cii:
popl saveret, *RR14
pop R2, *RR14
pop R1, *RR14
sub R2, R1 !expansion in bytes
jr LE, 1f
sra R2 !expansion in words > 0
jr NC, 2f
pop R1, *RR14 !expand 1 --> 2
extsb R1
push *RR14, R1
test R2
jr EQ, 4f
2: !expand >= 1 word
ld R1, *RR14
exts RR0
3: push *RR14, R0
djnz R2, 3b
jr 4f
1: sub R15, R2
4: pushl *RR14, saveret
ret