move.l d0,d1
lsl.l #2,d1
lea addresstable,a0
move.l (a0,d1.l),a1
jsr (a1) ;Jump to fetched address
move.w #$95,d1
moveq.l #0,d0
addresstable:
dc.l $00004000,$00004046,$0000502A,...
A very convenient technique, except if the programmer has the stupid idea to use the unused most significant byte of an address (for instance at location (addresstable)) to store 1 byte data, such as a counter. Then, the JSR will only be correct if the value is 0, else it will crash.
Jump tablosunun kullanılmayan bitini sayaç olarak kullanmak nasıl bir zihniyettir. Üniversitelerde spagetti koda örnek olarak gösterilebilir herhalde.