To make what the code does easier to understand, its useful to convert jump
offsets to actual labels, thus:
Code: Select all
L04D4 moveq #$00,d0
move.b $00(a6,a3.l),d0 some byte code
... prepare it
move.w L04EE(pc,d0.w),d1 get corresponding table offset
jmp L04EE(pc,d1.w) and go resulting label
*
L04EE dc.w L050C-L04EE dc.w $001E
dc.w L0510-L04EE dc.w $0022
dc.w L053C-L04EE dc.w $004E
dc.w L050C-L04EE dc.w $001E
dc.w L0526-L04EE dc.w $0038
dc.w L052A-L04EE dc.w $003C
...
L050C
...
L0510
...
etc
However, I struggle to make sense of the following jump table:
Code: Select all
...
L05D2 moveq #$00,d3
L05D4 move.b (a4)+,d3
bne.s L05DA
move.b (a4)+,d3
L05DA move.w L061E(pc,d3.w),d0
jmp L0620(pc,d0.w)
...
L061E bra.s L05D4
L0620 dc.w $0B56
dc.w $045A
dc.w $FFF2
dc.w $FFF8
dc.w $04BA
dc.w $04F4
dc.w $0380
dc.w $03AC
...
etc
We have a general idea of the function of this code: It is Qlib's main
interpreter bus to distribute the program flow to the routines which handle each
token. Its just I dont seem able to get my head around how the mechanism works.
Any help converting this table to something useful, like in the first example,
above, would be much appreciated.