6502/6510/8500/8502 Opcode matrix:
imm = #$00x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
0x | BRK 7 |
ORA izx 6 |
KIL | SLO izx 8 |
NOP zp 3 |
ORA zp 3 |
ASL zp 5 |
SLO zp 5 |
PHP 3 |
ORA imm 2 |
ASL 2 |
ANC imm 2 |
NOP abs 4 |
ORA abs 4 |
ASL abs 6 |
SLO abs 6 |
1x | BPL rel 2* |
ORA izy 5* |
KIL | SLO izy 8 |
NOP zpx 4 |
ORA zpx 4 |
ASL zpx 6 |
SLO zpx 6 |
CLC 2 |
ORA aby 4* |
NOP 2 |
SLO aby 7 |
NOP abx 4* |
ORA abx 4* |
ASL abx 7 |
SLO abx 7 |
2x | JSR abs 6 |
AND izx 6 |
KIL | RLA izx 8 |
BIT zp 3 |
AND zp 3 |
ROL zp 5 |
RLA zp 5 |
PLP 4 |
AND imm 2 |
ROL 2 |
ANC imm 2 |
BIT abs 4 |
AND abs 4 |
ROL abs 6 |
RLA abs 6 |
3x | BMI rel 2* |
AND izy 5* |
KIL | RLA izy 8 |
NOP zpx 4 |
AND zpx 4 |
ROL zpx 6 |
RLA zpx 6 |
SEC 2 |
AND aby 4* |
NOP 2 |
RLA aby 7 |
NOP abx 4* |
AND abx 4* |
ROL abx 7 |
RLA abx 7 |
4x | RTI 6 |
EOR izx 6 |
KIL | SRE izx 8 |
NOP zp 3 |
EOR zp 3 |
LSR zp 5 |
SRE zp 5 |
PHA 3 |
EOR imm 2 |
LSR 2 |
ALR imm 2 |
JMP abs 3 |
EOR abs 4 |
LSR abs 6 |
SRE abs 6 |
5x | BVC rel 2* |
EOR izy 5* |
KIL | SRE izy 8 |
NOP zpx 4 |
EOR zpx 4 |
LSR zpx 6 |
SRE zpx 6 |
CLI 2 |
EOR aby 4* |
NOP 2 |
SRE aby 7 |
NOP abx 4* |
EOR abx 4* |
LSR abx 7 |
SRE abx 7 |
6x | RTS 6 |
ADC izx 6 |
KIL | RRA izx 8 |
NOP zp 3 |
ADC zp 3 |
ROR zp 5 |
RRA zp 5 |
PLA 4 |
ADC imm 2 |
ROR 2 |
ARR imm 2 |
JMP ind 5 |
ADC abs 4 |
ROR abs 6 |
RRA abs 6 |
7x | BVS rel 2* |
ADC izy 5* |
KIL | RRA izy 8 |
NOP zpx 4 |
ADC zpx 4 |
ROR zpx 6 |
RRA zpx 6 |
SEI 2 |
ADC aby 4* |
NOP 2 |
RRA aby 7 |
NOP abx 4* |
ADC abx 4* |
ROR abx 7 |
RRA abx 7 |
8x | NOP imm 2 |
STA izx 6 |
NOP imm 2 |
SAX izx 6 |
STY zp 3 |
STA zp 3 |
STX zp 3 |
SAX zp 3 |
DEY 2 |
NOP imm 2 |
TXA 2 |
XAA imm 2 |
STY abs 4 |
STA abs 4 |
STX abs 4 |
SAX abs 4 |
9x | BCC rel 2* |
STA izy 6 |
KIL | AHX izy 6 |
STY zpx 4 |
STA zpx 4 |
STX zpy 4 |
SAX zpy 4 |
TYA 2 |
STA aby 5 |
TXS 2 |
TAS aby 5 |
SHY abx 5 |
STA abx 5 |
SHX aby 5 |
AHX aby 5 |
Ax | LDY imm 2 |
LDA izx 6 |
LDX imm 2 |
LAX izx 6 |
LDY zp 3 |
LDA zp 3 |
LDX zp 3 |
LAX zp 3 |
TAY 2 |
LDA imm 2 |
TAX 2 |
LAX imm 2 |
LDY abs 4 |
LDA abs 4 |
LDX abs 4 |
LAX abs 4 |
Bx | BCS rel 2* |
LDA izy 5* |
KIL | LAX izy 5* |
LDY zpx 4 |
LDA zpx 4 |
LDX zpy 4 |
LAX zpy 4 |
CLV 2 |
LDA aby 4* |
TSX 2 |
LAS aby 4* |
LDY abx 4* |
LDA abx 4* |
LDX aby 4* |
LAX aby 4* |
Cx | CPY imm 2 |
CMP izx 6 |
NOP imm 2 |
DCP izx 8 |
CPY zp 3 |
CMP zp 3 |
DEC zp 5 |
DCP zp 5 |
INY 2 |
CMP imm 2 |
DEX 2 |
AXS imm 2 |
CPY abs 4 |
CMP abs 4 |
DEC abs 6 |
DCP abs 6 |
Dx | BNE rel 2* |
CMP izy 5* |
KIL | DCP izy 8 |
NOP zpx 4 |
CMP zpx 4 |
DEC zpx 6 |
DCP zpx 6 |
CLD 2 |
CMP aby 4* |
NOP 2 |
DCP aby 7 |
NOP abx 4* |
CMP abx 4* |
DEC abx 7 |
DCP abx 7 |
Ex | CPX imm 2 |
SBC izx 6 |
NOP imm 2 |
ISC izx 8 |
CPX zp 3 |
SBC zp 3 |
INC zp 5 |
ISC zp 5 |
INX 2 |
SBC imm 2 |
NOP 2 |
SBC imm 2 |
CPX abs 4 |
SBC abs 4 |
INC abs 6 |
ISC abs 6 |
Fx | BEQ rel 2* |
SBC izy 5* |
KIL | ISC izy 8 |
NOP zpx 4 |
SBC zpx 4 |
INC zpx 6 |
ISC zpx 6 |
SED 2 |
SBC aby 4* |
NOP 2 |
ISC aby 7 |
NOP abx 4* |
SBC abx 4* |
INC abx 7 |
ISC abx 7 |
Opcode | imp | imm | zp | zpx | zpy | izx | izy | abs | abx | aby | ind | rel | Function | N | V | B | D | I | Z | C |
ORA | $09 | $05 | $15 | $01 | $11 | $0D | $1D | $19 | A:=A or {adr} | * | * | |||||||||
AND | $29 | $25 | $35 | $21 | $31 | $2D | $3D | $39 | A:=A&{adr} | * | * | |||||||||
EOR | $49 | $45 | $55 | $41 | $51 | $4D | $5D | $59 | A:=A exor {adr} | * | * | |||||||||
ADC | $69 | $65 | $75 | $61 | $71 | $6D | $7D | $79 | A:=A+{adr} | * | * | * | * | |||||||
SBC | $E9 | $E5 | $F5 | $E1 | $F1 | $ED | $FD | $F9 | A:=A-{adr} | * | * | * | * | |||||||
CMP | $C9 | $C5 | $D5 | $C1 | $D1 | $CD | $DD | $D9 | A-{adr} | * | * | * | ||||||||
CPX | $E0 | $E4 | $EC | X-{adr} | * | * | * | |||||||||||||
CPY | $C0 | $C4 | $CC | Y-{adr} | * | * | * | |||||||||||||
DEC | $C6 | $D6 | $CE | $DE | {adr}:={adr}-1 | * | * | |||||||||||||
DEX | $CA | X:=X-1 | * | * | ||||||||||||||||
DEY | $88 | Y:=Y-1 | * | * | ||||||||||||||||
INC | $E6 | $F6 | $EE | $FE | {adr}:={adr}+1 | * | * | |||||||||||||
INX | $E8 | X:=X+1 | * | * | ||||||||||||||||
INY | $C8 | Y:=Y+1 | * | * | ||||||||||||||||
ASL | $0A | $06 | $16 | $0E | $1E | {adr}:={adr}*2 | * | * | * | |||||||||||
ROL | $2A | $26 | $36 | $2E | $3E | {adr}:={adr}*2+C | * | * | * | |||||||||||
LSR | $4A | $46 | $56 | $4E | $5E | {adr}:={adr}/2 | * | * | * | |||||||||||
ROR | $6A | $66 | $76 | $6E | $7E | {adr}:={adr}/2+C*128 | * | * | * |
Opcode | imp | imm | zp | zpx | zpy | izx | izy | abs | abx | aby | ind | rel | Function | N | V | B | D | I | Z | C |
LDA | $A9 | $A5 | $B5 | $A1 | $B1 | $AD | $BD | $B9 | A:={adr} | * | * | |||||||||
STA | $85 | $95 | $81 | $91 | $8D | $9D | $99 | {adr}:=A | ||||||||||||
LDX | $A2 | $A6 | $B6 | $AE | $BE | X:={adr} | * | * | ||||||||||||
STX | $86 | $96 | $8E | {adr}:=X | ||||||||||||||||
LDY | $A0 | $A4 | $B4 | $AC | $BC | Y:={adr} | * | * | ||||||||||||
STY | $84 | $94 | $8C | {adr}:=Y | ||||||||||||||||
TAX | $AA | X:=A | * | * | ||||||||||||||||
TXA | $8A | A:=X | * | * | ||||||||||||||||
TAY | $A8 | Y:=A | * | * | ||||||||||||||||
TYA | $98 | A:=Y | * | * | ||||||||||||||||
TSX | $BA | X:=S | * | * | ||||||||||||||||
TXS | $9A | S:=X | ||||||||||||||||||
PLA | $68 | A:=+(S) | * | * | ||||||||||||||||
PHA | $48 | (S)-:=A | ||||||||||||||||||
PLP | $28 | P:=+(S) | * | * | * | * | * | * | ||||||||||||
PHP | $08 | (S)-:=P |
Opcode | imp | imm | zp | zpx | zpy | izx | izy | abs | abx | aby | ind | rel | Function | N | V | B | D | I | Z | C |
BPL | $10 | branch on N=0 | ||||||||||||||||||
BMI | $30 | branch on N=1 | ||||||||||||||||||
BVC | $50 | branch on V=0 | ||||||||||||||||||
BVS | $70 | branch on V=1 | ||||||||||||||||||
BCC | $90 | branch on C=0 | ||||||||||||||||||
BCS | $B0 | branch on C=1 | ||||||||||||||||||
BNE | $D0 | branch on Z=0 | ||||||||||||||||||
BEQ | $F0 | branch on Z=1 | ||||||||||||||||||
BRK | $00 | (S)-:=PC,P PC:=($FFFE) | 1 | 1 | ||||||||||||||||
RTI | $40 | P,PC:=+(S) | * | * | * | * | * | * | ||||||||||||
JSR | $20 | (S)-:=PC PC:={adr} | ||||||||||||||||||
RTS | $60 | PC:=+(S) | ||||||||||||||||||
JMP | $4C | $6C | PC:={adr} | |||||||||||||||||
BIT | $24 | $2C | N:=b7 V:=b6 Z:=A&{adr} | * | * | * | ||||||||||||||
CLC | $18 | C:=0 | 0 | |||||||||||||||||
SEC | $38 | C:=1 | 1 | |||||||||||||||||
CLD | $D8 | D:=0 | 0 | |||||||||||||||||
SED | $F8 | D:=1 | 1 | |||||||||||||||||
CLI | $58 | I:=0 | 0 | |||||||||||||||||
SEI | $78 | I:=1 | 1 | |||||||||||||||||
CLV | $B8 | V:=0 | 0 | |||||||||||||||||
NOP | $EA |
Opcode | imp | imm | zp | zpx | zpy | izx | izy | abs | abx | aby | ind | rel | Function | N | V | B | D | I | Z | C |
SLO | $07 | $17 | $03 | $13 | $0F | $1F | $1B | {adr}:={adr}*2 A:=A or {adr} | * | * | * | |||||||||
RLA | $27 | $37 | $23 | $33 | $2F | $3F | $3B | {adr}:={adr}rol A:=A and {adr} | * | * | * | |||||||||
SRE | $47 | $57 | $43 | $53 | $4F | $5F | $5B | {adr}:={adr}/2 A:=A exor {adr} | * | * | * | |||||||||
RRA | $67 | $77 | $63 | $73 | $6F | $7F | $7B | {adr}:={adr}ror A:=A adc {adr} | * | * | * | * | ||||||||
SAX | $87 | $97 | $83 | $8F | {adr}:=A&X | |||||||||||||||
LAX | $A7 | $B7 | $A3 | $B3 | $AF | $BF | A,X:={adr} | * | * | |||||||||||
DCP | $C7 | $D7 | $C3 | $D3 | $CF | $DF | $DB | {adr}:={adr}-1 A-{adr} | * | * | * | |||||||||
ISC | $E7 | $F7 | $E3 | $F3 | $EF | $FF | $FB | {adr}:={adr}+1 A:=A-{adr} | * | * | * | * | ||||||||
ANC | $0B | A:=A&#{imm} | * | * | * | |||||||||||||||
ANC | $2B | A:=A&#{imm} | * | * | * | |||||||||||||||
ALR | $4B | A:=(A&#{imm})/2 | * | * | * | |||||||||||||||
ARR | $6B | A:=(A&#{imm})/2 | * | * | * | * | ||||||||||||||
XAA² | $8B | A:=X&#{imm} | * | * | ||||||||||||||||
LAX² | $AB | A,X:=#{imm} | * | * | ||||||||||||||||
AXS | $CB | X:=A&X-#{imm} | * | * | * | |||||||||||||||
SBC | $EB | A:=A-#{imm} | * | * | * | * | ||||||||||||||
AHX¹ | $93 | $9F | {adr}:=A&X&H | |||||||||||||||||
SHY¹ | $9C | {adr}:=Y&H | ||||||||||||||||||
SHX¹ | $9E | {adr}:=X&H | ||||||||||||||||||
TAS¹ | $9B | S:=A&X {adr}:=S&H | ||||||||||||||||||
LAS | $BB | A,X,S:={adr}&S | * | * |