Pointers and references: Difference between revisions
m
→{{header|Z80 Assembly}}
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 2,073:
ld e,(hl) ;load the E register with the byte at memory address &D000.
ld bc,(&E000) ;load the register pair BC from memory address &E000. The Game Boy cannot use this addressing mode.
; This is the same as:
; ld a,(&E000)
Line 2,081:
ld IX,&F000
ld a,(IX+3) ;load A with the byte stored at &F003, The Game Boy cannot use this addressing mode.</lang>
Keep in mind that <code>HL</code>, <code>IX</code>, and <code>IY</code> are more flexible in the valid addressing modes that can be used.
Below are examples of code that are '''not valid''' and will be rejected by your assembler
<lang z80>ld h,(bc) ;if (bc) or (de) is the operand of a LD command, the other operand must be A.
|