Category:Z80 Assembly: Difference between revisions

m
changed tags to display code correctly
m (changed tags to display code correctly)
Line 46:
* & or $ represents hexadecimal, and % represents binary.
* A register or a 16-bit value in parentheses represents a pointer being dereferenced. The size of the data pointed to will be the same as the size of the destination.
<syntaxhighlight lang="Z80">
<lang z80>LD A,($4000) ;load the BYTE at memory address $4000 into the accumulator.
LD HLA,($60004000) ;load the WORDBYTE at memory address $60004000 into HL.the accumulator.
<lang z80>LD AHL,($40006000) ;load the BYTEWORD at memory address $40006000 into the accumulatorHL.
;Or, more accurately, load the BYTE at $6000 into L and the BYTE at $6001 into H.
LD A,(HL) ;The value stored in HL is treated as a memory address, and the BYTE at that address is loaded into the accumulator.</lang>
</syntaxhighlight>
 
==Efficient Coding Tricks==