6500 Registers
General Purpose Registers
A (Accumulator)
Used for arithmetic and logic operations.
Example:
LDA #$10 ; Load immediate value 16 into A ADC #$05 ; Add 5 to A, result in A
X (Index Register X)
Used for indexing memory locations.
Example:
LDX #$03 ; Load immediate value 3 into X LDA $2000,X ; Load value from address $2000 + X into A
Y (Index Register Y)
Used for indexing memory locations.
Example:
LDY #$04 ; Load immediate value 4 into Y LDA $2000,Y ; Load value from address $2000 + Y 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
Status Register
P (Processor Status)
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 6500 assembly programming, providing the necessary functionality for arithmetic, data manipulation, control flow, and memory access.
Last modified: 15 December 2024