RosettaCodeData/Task/Pointers-and-references/Z80-Assembly/pointers-and-references-6.z80
2023-07-01 13:44:08 -04:00

15 lines
332 B
Z80 Assembly

ld hl,PointerTable
ld a,(index)
add a ;this is a table of 16-bit values so double our index
add L
ld L,a
ld a,H
adc 0
ld H,a ;offset HL by our index
ld e,(hl)
inc hl
ld d,(hl) ;get the Ath entry of PointerTable and store it into DE.
ld (referenceStorage),DE ;store DE into ram for later use as a reference.