RosettaCodeData/Task/Gotchas/Z80-Assembly/gotchas-1.z80
2023-07-01 13:44:08 -04:00

5 lines
322 B
Z80 Assembly

LD HL,(&C000) ;load the word at address &C000 into HL
LD A,(HL) ;treating the value in HL as a memory address, load the byte at that address into A.
EX (SP),HL ;exchange HL with the top two bytes of the stack.
JP (HL) ;set the program counter equal to HL. Nothing is loaded from memory pointed to by HL.