inn.s 539 B

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