
;
; jump table. index in A
; address of jump table in dptr
; maximum of 256/3 entries
;
do_jtable:
   mov b,#3
   mul a,b          ;each jump is three bytes
   jmp @a+dptr      ;goto required routine


jtable
   ljmp routine0
   ljmp routine1
   ljmp routine2
 .......

to use this code you would..
 mov a,#3    ;call routine#3
 mov dptr,#jtable
 call do_jtable
......

routine3
  ..
 ...
  ret


