Your progress
Your place is saved automatically on this browser.
Why does $6000 appear as 00 60?
The instruction LD HL,$6000 assembled as:
21 00 60The opcode is $21. The following two bytes represent the 16-bit value $6000, but they appear as $00 followed by $60.
The Z80 stores 16-bit immediate values in little-endian order: the low byte comes first, followed by the high byte.
$6000
high byte = $60
low byte = $00
stored in instruction = 00 60This often feels backwards at first. It becomes familiar with practice, and it matters later when working with pointers, files, data structures and operating-system calls.
