diff --git a/mach/m68k4/libem/inn.s b/mach/m68k4/libem/inn.s index ef0176274..6c449bb93 100644 --- a/mach/m68k4/libem/inn.s +++ b/mach/m68k4/libem/inn.s @@ -1,34 +1,32 @@ -.define .inn +.define .inn .sect .text .sect .rom .sect .data .sect .bss +.sect .text -! d0 : set size in bytes -! d1 : bitnumber +.inn: ! d0 bitnumber + ! d1 setsize in bytes + ! on exit: 0 or 1 in d0 - .sect .text -.inn: - move.l (sp)+,a1 - move.l (sp)+,d1 - move.l d0,-(sp) - move.l sp,a0 - add.l #4,a0 - move.l d1,d2 - asr.l #3,d2 - cmp.l d0,d2 - 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 + move.l d2, -(sp) + move.l d0, d2 + asr.l #3, d2 ! offset .sect from sp in bytes + eor.l #3, d2 ! longs are stored in high-to-low order + cmp.l d1, d2 + bge 1f ! bitnumber too large + btst d0, 8(sp, d2.l) + beq 2f + move.l #1, d0 + bra 3f 1: - clr.l d0 + move.l #ESET, -(sp) + jsr .trp 2: - move.l (sp)+,d1 - add.l d1,sp - jmp (a1) + clr.l d0 +3: + move.l (sp)+, d2 + move.l (sp)+, a0 ! return address + add.l d1, sp ! pop bitset + jmp (a0) ! return +.align 2