Fraks version
This commit is contained in:
parent
ac395ba4a6
commit
13c208de3b
|
@ -1,25 +1,29 @@
|
||||||
.define .cmi, .cmi_
|
.define .cmi
|
||||||
.sect .text
|
.sect .text
|
||||||
.sect .rom
|
.sect .rom
|
||||||
.sect .data
|
.sect .data
|
||||||
.sect .bss
|
.sect .bss
|
||||||
|
|
||||||
! NUM == 4
|
.sect .text
|
||||||
! result in d1
|
! on entry d0: # bytes of 1 block
|
||||||
.sect .text
|
! on exit d0: result
|
||||||
.cmi:
|
.cmi:
|
||||||
.cmi_:
|
move.l (sp)+, d2 ! return address
|
||||||
move.l (sp)+,d2
|
move.l sp, a0 ! address of top block
|
||||||
move.l #1,d1
|
lea 0(sp, d0.l), a1 ! address of lower block
|
||||||
move.l (sp)+,d0
|
move.l d0, d1
|
||||||
cmp.l (sp)+,d0
|
asr.l #2, d0
|
||||||
bne 1f
|
1:
|
||||||
clr.l d1
|
cmp.l (a0)+, (a1)+
|
||||||
1:
|
bne 2f
|
||||||
ble 2f
|
sub.l #1, d0
|
||||||
neg.l d1
|
bne 1b
|
||||||
2:
|
2:
|
||||||
move.l d2,-(sp)
|
bge 3f
|
||||||
|
neg.l d0 ! less
|
||||||
|
3:
|
||||||
|
asl.l #1, d1
|
||||||
|
add.l d1, sp ! new sp; two blocks popped
|
||||||
|
move.l d2, -(sp)
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.align 2
|
.align 2
|
||||||
|
|
Loading…
Reference in a new issue