csa.s 518 B

1234567891011121314151617181920212223242526272829303132
  1. .define .csa4
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. .csa4:
  8. ! case descriptor in a0
  9. ! index in d0
  10. move.l (a0)+,a1 ! default address
  11. sub.l (a0)+,d0 ! index - lower bound
  12. blt 1f
  13. cmp.l (a0)+,d0 ! rel. index <-> upper - lower bound
  14. bgt 1f
  15. asl.l #2,d0
  16. add.l d0,a0
  17. move.l (a0),d0 ! test jump address
  18. beq 1f
  19. move.l d0,-(sp)
  20. bra 3f
  21. 1:
  22. move.l a1,d0 ! test default jump address
  23. beq 2f
  24. move.l a1,-(sp) ! jump address
  25. 3:
  26. rts ! not a real rts
  27. 2:
  28. move.l #ECASE,-(sp)
  29. jmp .fatal
  30. .align 2