Category:6502 Assembly: Difference between revisions

No edit summary
Line 317:
* A numeral with no <code>$</code> or <code>%</code> in front represents a decimal value.
* A numeral without a <code>#</code> in front is interpreted as a memory address, regardless of whether it is decimal, binary, or hexadecimal. <code>LDA 0</code> will load <i>the value at zero page memory address $00</i> into the accumulator. If you want to load the number 0 into the accumulator you need to type <code>LDA #0</code>.
===ORG===
 
In the modern era, the advent of linkers, dynamically linked libraries, and the use of <code>INT</code> and <code>SVC</code> to perform I/O operations have rendered this concept mostly obsolete. The <code>org</code> directive (sometimes preceded with a period) tells the assembler where the beginning of a section of code is. Some sections of code will only function in a specific location, so this is often necessary to ensure the code or data table goes where it should. You wouldn't want your executable code in the zero page, for example.
===Value Labels===
Whether a given number is written in binary, hexadecimal, or decimal does not affect the assembled code. The resulting bytecode is the same regardless. For example,
1,489

edits