A83: Re: jump table
[Prev][Next][Index][Thread]
A83: Re: jump table
; jump to the label number stored in A (i.e. 0 == Label1)
ld h,0
ld l,a
add hl,hl ; labels are two bytes, multiply by two
ld de,JumpTable
add hl,de ; add to the start address of the jump table
ld a,(hl) ; next four instructions = ld hl,(hl)
inc hl
ld h,(hl)
ld l,a
jp (hl) ; jump to the address stored in HL, not really (HL)
JumpTable:
.dw Label1, Label2, Label3
> can you pls send me an example of a jump tavble
> thanks in advance
References: