ack/mach/m68k4/libem/cmi.s

30 lines
458 B
ArmAsm
Raw Normal View History

1987-03-27 09:50:57 +00:00
.define .cmi
.sect .text
.sect .rom
.sect .data
.sect .bss
1985-02-07 22:06:32 +00:00
1987-03-27 09:50:57 +00:00
.sect .text
! on entry d0: # bytes of 1 block
! on exit d0: result
1985-02-07 22:06:32 +00:00
.cmi:
1987-03-27 09:50:57 +00:00
move.l (sp)+, d2 ! return address
move.l sp, a0 ! address of top block
lea 0(sp, d0.l), a1 ! address of lower block
move.l d0, d1
asr.l #2, d0
1:
cmp.l (a0)+, (a1)+
bne 2f
sub.l #1, d0
bne 1b
2:
bge 3f
neg.l d0 ! less
3:
asl.l #1, d1
add.l d1, sp ! new sp; two blocks popped
move.l d2, -(sp)
1985-02-07 22:06:32 +00:00
rts
.align 2