spo600:assembler_basics
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| spo600:assembler_basics [2024/05/08 03:44] – chris | spo600:assembler_basics [2025/02/11 11:58] (current) – chris | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ===== Format of an Assembly Language program | ===== Format of an Assembly Language program | ||
| - | The traditional extension for assembly-language source files is '' | + | The traditional extension for assembly-language source files that will be used as input to an assembler |
| An assembly-language program consists of: | An assembly-language program consists of: | ||
| Line 62: | Line 62: | ||
| ===== 6502 Assembly Language in the Emulator | ===== 6502 Assembly Language in the Emulator | ||
| - | The [[6502 Emulator]] provides a very simple assembler for [[6502]] code: | + | The [[6502 Emulator]] provides a very simple assembler for [[6502]] code. Each line contains one instruction in assembly language, or one of these directives: |
| * Simple text-substitution macros can be defined with '' | * Simple text-substitution macros can be defined with '' | ||
| < | < | ||
| Line 72: | Line 73: | ||
| dcb " | dcb " | ||
| dcb " | dcb " | ||
| - | * The current assembly pointer starts at $0600 and increments with output bytes; it can be changed with this syntax: | + | * The current assembly pointer starts at $0600 and increments with output bytes; it can be changed with this directive: |
| < | < | ||
| *=$0800</ | *=$0800</ | ||
| Line 81: | Line 82: | ||
| On a Linux system, you will need to meet three requirements to get your assembly language program to work: | On a Linux system, you will need to meet three requirements to get your assembly language program to work: | ||
| - | - Code must be placed in the '' | + | - Code must be placed in the '' |
| - Data must be placed in either the '' | - Data must be placed in either the '' | ||
| - There must be a globally-defined symbol which the linker ('' | - There must be a globally-defined symbol which the linker ('' | ||
| Line 89: | Line 90: | ||
| ==== Compiling an Assembly Language Program using the GNU Assembler | ==== Compiling an Assembly Language Program using the GNU Assembler | ||
| - | - Run the assembler: '' | + | - Run the assembler: '' |
| - Run the linker: '' | - Run the linker: '' | ||
| - | Note that the '' | + | Note that the '' |
| ==== Compiling an Assembly Language Program using the NASM Assembler | ==== Compiling an Assembly Language Program using the NASM Assembler | ||
| Line 100: | Line 101: | ||
| Notes: | Notes: | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| ==== Compiling an Assembly Language program using GCC ==== | ==== Compiling an Assembly Language program using GCC ==== | ||
spo600/assembler_basics.1715139876.txt.gz · Last modified: 2024/05/08 07:44 (external edit)
