Frans Doodemans version

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

View file

@ -3,32 +3,30 @@
.sect .rom .sect .rom
.sect .data .sect .data
.sect .bss .sect .bss
! d0 : set size in bytes
! d1 : bitnumber
.sect .text .sect .text
.inn:
move.l (sp)+,a1 .inn: ! d0 bitnumber
move.l (sp)+,d1 ! d1 setsize in bytes
move.l d0,-(sp) ! on exit: 0 or 1 in d0
move.l sp,a0
add.l #4,a0 move.l d2, -(sp)
move.l d1,d2 move.l d0, d2
asr.l #3,d2 asr.l #3, d2 ! offset .sect from sp in bytes
cmp.l d0,d2 eor.l #3, d2 ! longs are stored in high-to-low order
bcc 1f cmp.l d1, d2
bclr #0,d2 bge 1f ! bitnumber too large
bclr #1,d2 btst d0, 8(sp, d2.l)
add.l d2,a0 beq 2f
move.l (a0),d2
btst d1,d2
beq 1f
move.l #1, d0 move.l #1, d0
bra 2f bra 3f
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