Address of a variable: Difference between revisions

m
No edit summary
Line 47:
</lang>
 
6502 assemblers treat a number without a # in front as a memory address.
<lang 6502asm>
LDA #$30 ;load into the accumulator the constant value 0x30
LDA $30 ;load into the accumulator the value stored at memory address 0x0030.</lang>
 
The only exception to this rule is when defining bytes. These do not have # in front, but are treated as constants nonetheless:
<lang 6502asm>byte $30,$20,$10,$00 ;these are constant numeric values, not memory addresses.</lang>
 
=={{header|68000 Assembly}}==
1,489

edits