6800 Registers
General Purpose Registers
A (Accumulator)
Used for arithmetic and logic operations.
Example:
LDA #$10 ; Load immediate value 16 into A ADD #$05 ; Add 5 to A, result in A
B (Accumulator)
Used for arithmetic and logic operations.
Example:
LDB #$20 ; Load immediate value 32 into B SUB #$05 ; Subtract 5 from B, result in B
Index Register
X (Index Register)
Used for indexing memory locations.
Example:
LDX #$1000 ; Load immediate value 4096 into X LDA $2000,X ; Load value from address $2000 + X into A
Stack Pointer
SP (Stack Pointer)
Points to the top of the stack.
Example:
TSX ; Transfer SP to X
Program Counter
PC (Program Counter)
Points to the next instruction to be executed.
Example:
JMP $3000 ; Jump to address $3000, PC is updated to $3000
Condition Code Register
CCR (Condition Code Register)
Contains flags that reflect the outcome of operations and control the CPU.
Example:
CLC ; Clear carry flag SEC ; Set carry flag
These registers are essential for various operations in 6800 assembly programming, providing the necessary functionality for arithmetic, data manipulation, control flow, and memory access.
Last modified: 20 November 2024