Immediate Addressing

From NES Hacker Wiki
Revision as of 17:57, 5 October 2012 by TheAlmightyGuru (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Immediate Addressing is used when the operand's value is given in the instruction itself. In 6502 assembly, this is indicated by an pound sign, "#", before the operand.


In this example, the first instruction uses Immediate Addressing, while the second instruction uses Zero-Page Addressing. In the first line, the accumulator is loaded with the number 7, but in the second line, the accumulator is loaded with whatever value is stored in memory address $0007.

0001:A9 07     LDA #$07        ; Load A with the value of $07.
0002:A5 07     LDA $07         ; Load A with whatever value is in memory address $0007.


The following opcodes support immediate addressing: