Category:Z80 Assembly: Difference between revisions
Content added Content deleted
m (changed tags to display code correctly) |
|||
Line 46: | Line 46: | ||
* & or $ represents hexadecimal, and % represents binary. |
* & 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. |
* 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"> |
|||
⚫ | |||
LD |
LD A,($4000) ;load the BYTE at memory address $4000 into the accumulator. |
||
⚫ | |||
;Or, more accurately, load the BYTE at $6000 into L and the BYTE at $6001 into H. |
;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. |
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. |
||
</syntaxhighlight> |
|||
==Efficient Coding Tricks== |
==Efficient Coding Tricks== |