inn.s 535 B

1234567891011121314151617181920212223242526272829303132
  1. .define .inn
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. .inn: ! d0 bitnumber
  8. ! d1 setsize in bytes
  9. ! on exit: 0 or 1 in d0
  10. move.l d2, -(sp)
  11. move.l d0, d2
  12. asr.l #3, d2 ! offset .sect from sp in bytes
  13. eor.l #3, d2 ! longs are stored in high-to-low order
  14. cmp.l d1, d2
  15. bge 1f ! bitnumber too large
  16. btst d0, 8(sp, d2.l)
  17. beq 2f
  18. move.l #1, d0
  19. bra 3f
  20. 1:
  21. move.l #ESET, -(sp)
  22. jsr .trp
  23. 2:
  24. clr.l d0
  25. 3:
  26. move.l (sp)+, d2
  27. move.l (sp)+, a0 ! return address
  28. add.l d1, sp ! pop bitset
  29. jmp (a0) ! return
  30. .align 2