1987-01-29 22:10:18 +00:00
|
|
|
.define .csa
|
|
|
|
.sect .text
|
|
|
|
.sect .rom
|
|
|
|
.sect .data
|
|
|
|
.sect .bss
|
1988-10-03 10:53:47 +00:00
|
|
|
ECASE=20
|
1987-01-29 22:10:18 +00:00
|
|
|
|
|
|
|
.sect .text
|
|
|
|
|
|
|
|
.csa:
|
1989-02-21 10:09:01 +00:00
|
|
|
! jump table address in a0
|
|
|
|
! index in d0
|
|
|
|
|
1987-01-29 22:10:18 +00:00
|
|
|
move.l (a0)+, a1 ! default address
|
|
|
|
sub.l (a0)+, d0 ! index - lower bound
|
|
|
|
blt 1f
|
|
|
|
cmp.l (a0)+, d0 ! rel. index, upper - lower bound
|
|
|
|
bgt 1f
|
1987-03-19 11:21:54 +00:00
|
|
|
move.l (a0,d0.l*4), d1 ! jump address
|
|
|
|
beq 1f
|
|
|
|
move.l d1,a1
|
1989-05-29 14:42:18 +00:00
|
|
|
jmp (a1)
|
1987-01-29 22:10:18 +00:00
|
|
|
1:
|
|
|
|
move.l a1, d0
|
|
|
|
beq 2f
|
|
|
|
jmp (a1) ! jump to specified address
|
|
|
|
2:
|
|
|
|
move.l #ECASE, -(sp)
|
|
|
|
jmp (.fatal)
|
|
|
|
.align 2
|