Gotchas: Difference between revisions

m
Line 9:
=={{header|6502 Assembly}}==
===Numeric Literals===
Integer literals used in instruction operands need to begin with a #, otherwise, the CPU considers them to be a pointer to memory, which will be dereferenced. This applies to any integer representation, even ASCII.
<syntaxhighlight lang="6502asm">LDA 'J' ;load the 8-bit value stored at memory address 0x004A into the accumulator.
OR 3 ;bitwise OR the accumulator with the 8-bit value stored at memory address 0x0003
Line 19:
 
<syntaxhighlight lang="6502asm">byte $45 ;this is the literal constant value $45, not "the value stored at memory address 0x0045"</syntaxhighlight>
 
 
===Memory-Mapped Hardware===
1,489

edits