Frans Doodemans version

This commit is contained in:
ceriel 1987-03-27 09:28:16 +00:00
parent f4fb73386e
commit 2febff1a79

View file

@ -1,34 +1,32 @@
.define .inn .define .inn
.sect .text .sect .text
.sect .rom .sect .rom
.sect .data .sect .data
.sect .bss .sect .bss
.sect .text
! d0 : set size in bytes .inn: ! d0 bitnumber
! d1 : bitnumber ! d1 setsize in bytes
! on exit: 0 or 1 in d0
.sect .text move.l d2, -(sp)
.inn: move.l d0, d2
move.l (sp)+,a1 asr.l #3, d2 ! offset .sect from sp in bytes
move.l (sp)+,d1 eor.l #3, d2 ! longs are stored in high-to-low order
move.l d0,-(sp) cmp.l d1, d2
move.l sp,a0 bge 1f ! bitnumber too large
add.l #4,a0 btst d0, 8(sp, d2.l)
move.l d1,d2 beq 2f
asr.l #3,d2 move.l #1, d0
cmp.l d0,d2 bra 3f
bcc 1f
bclr #0,d2
bclr #1,d2
add.l d2,a0
move.l (a0),d2
btst d1,d2
beq 1f
move.l #1,d0
bra 2f
1: 1:
clr.l d0 move.l #ESET, -(sp)
jsr .trp
2: 2:
move.l (sp)+,d1 clr.l d0
add.l d1,sp 3:
jmp (a1) move.l (sp)+, d2
move.l (sp)+, a0 ! return address
add.l d1, sp ! pop bitset
jmp (a0) ! return
.align 2