Summary of 6502 Opcodes
------- -- ---- -------
ADC Add to accumulator with carry.
AND "AND" with accumulator.
ASL Arithmetic Shift Left. Bit0=0 C=Bit7.
BCC Branch on Carry Clear.
BCS Branch on Carry Set.
BEQ Branch on result Equal (zero).
BIT Test bits in memory with accumulator.
BMI Branch on result Minus.
BNE Branch on result Not Equal (not zero).
BPL Branch on result Plus.
BRK Forced BREAK.
BVC Branch on overflow Clear.
BVS Branch on overflow Set.
CLC Clear Carry flag.
CLD Clear Decimal mode.
CLI Clear Interrupt disable bit.
CLV Clear overflow flag.
CMP Compare with accumulator.
CPX Compare with X register.
CPY Compare with Y register.
DEC Decrement memory by one.
DEX Decrement X register by one.
DEY Decrement Y register by one.
EOR "Exclusive-OR" with accumulator.
INC Increment memory by one.
INX Increment X register by one.
INY Increment Y register by one.
JMP Unconditional Jump to new address.
JSR Unconditional Jump, saving return address.
LDA Load accumulator.
LDX Load X register.
LDY Load Y register.
LSR Logical Shift Right. Bit7=0 C=Bit0.
NOP No Operation.
ORA "OR" with accumulator.
PHA Push Accumulator on stack.
PHP Push Processor status register on stack.
PLA Pull Accumulator from stack.
PLP Pull Processor status register from stack.
ROL Rotate one bit Left (mem. or acc.). C=Bit7 Bit0=C.
ROR Rotate one bit Right (mem. or acc.). C=Bit0 Bit7=C.
RTI Return from Interrupt.
RTS Return from Subroutine.
SBC Subtract from accumulator with borrow.
SEC Set Carry flag.
SED Set Decimal mode.
SEI Set Interrupt disable status.
STA Store Accumulator in memory.
STX Store X register in memory.
STY Store Y register in memory.
TAX Transfer Accumulator to X register.
TAY Transfer Accumulator to Y register.
TSX Transfer Stack pointer to X register.
TXA Transfer X register to Accumulator.
TXS Transfer X register to Stack pointer.
TYA Transfer Y register to Accumulator.
The Processor Status Register, "P"
--- --------- ------ --------- ---
7 6 5 4 3 2 1 0
N V B D I Z C
7 N Negative
6 V Overflow
5 <..Future expansion..>
4 B BRK command
3 D Decimal mode
2 I IRQ disable
1 Z Zero
0 C Carry
Addressing Modes of 6502 Assembly Code
---------- ----- -- ---- -------- ----
LDA #$07 Immediate mode
LDA $1F Zero page absolute
LDA $0800 Absolute
CLC Implied
JMP ($0036) Indirect absolute
LDA $FE90,X Absolute indexed (by X)
LDA $FE90,Y Absolute indexed (by Y)
LDA $2A,X Zero page indexed
LDA ($2A,X) Indexed indirect
LDA ($2A),Y Indirect indexed
BCC $03 Relative
BCC $0803 Relative (alternate form)
LSR A Accumulator
LSR Accumulator (alternate form)