參考資料:
http://nesdev.com/6502.txt
http://wiki.nesdev.com/w/index.php/Nesdev_Wiki
http://www.6502.org/tutorials/6502opcodes.html
https://www.masswerk.at/6502/6502_instruction_set.html
x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x | BRK | ORA X, ind | ORA zero | ASL zero | PHP | ORA # | ASL A | ORA abs | ASL abs | |||||||
1x | BPL rel | ORA ind, Y | ORA zero, X | ASL zero, X | CPC | ORA abs, Y | ORA abs, X | ASL abs, X | ||||||||
2x | JSR abs | AND X, ind | BIT zero | AND zero | ROL zero | PLP | AND # | ROL A | BIT abs | AND abs | ROL abs | |||||
3x | BMI rel | AND ind, Y | AND zero, X | ROL zero, X | SEC | AND abs, Y | AND abs, X | ROL abs, X | ||||||||
4x | RTI | EOR X, ind | EOR zero | LSR zero | PHA | EOR # | LSR A | JMP abs | EOR abs | LSR abs | ||||||
5x | BVC rel | EOR ind, Y | EOR zero, X | LSR zero, X | CLI | EOR abs, Y | EOR abs, X | LSR abs, X | ||||||||
6x | RTS | ADC X, ind | ADC zero | ROR zero | PLA | ADC # | ROR A | JMP ind | ADC abs | ROR abs | ||||||
7x | BVS rel | ADC ind, Y | ADC zero, X | ROR zero, X | SEI | ADC abs, Y | ADC abs, X | ROR abs, X | ||||||||
8x | STA X, ind | STY zero | STA zero | STX zero | DEY | TXA | STY abs | STA abs | STX abs | |||||||
9x | BCC rel | STA ind, Y | STY zero, X | STA zero, X | STX zero, X | TYA | STA abs, Y | TXS | STA abs, X | |||||||
Ax | LDY # | LDA X, ind | LDX # | LDY zero | LDA zero | LDX zero | TAY | LDA # | TAX | LDY abs | LDA abs | LDX abs | ||||
Bx | BCS rel | LDA ind, Y | LDY zero, X | LDA zero, X | LDX zero, Y | CLV | LDA abs, Y | TSX | LDY abs, X | LDA abs, X | LDX abs, Y | |||||
Cx | CPY # | CMP X, ind | CPY zero | CMP zero | DEC zero | INY | CMP # | DEX | CPY abs | CMP abs | DEC abs | |||||
Dx | BNE rel | CMP ind, Y | CMP zero, X | DEC zero, X | CLD | CMP abs, Y | CMP abs, X | DEC abs, X | ||||||||
Ex | CPX # | SBC X, ind | CPX zero | SBC zero | INC zero | INX | SBC # | NOP | CPX abs | SBC abs | INC abs | |||||
Fx | BEQ rel | SBC ind, Y | SBC zero, X | INC zero, X | SED | SBC abs, Y | SBC abs, X | INC abs, X |
Cycles
Assembly | Opode | Bytes | Cycles |
---|---|---|---|
ADC #Immediate | 69 | 2 | 2 |
ADC ZeroPage | 65 | 2 | 3 |
ADC ZeroPage,X | 75 | 2 | 4 |
ADC Absolute | 60 | 3 | 4 |
ADC Absolute,X | 70 | 3 | 4* |
ADC Absolute,Y | 79 | 3 | 4* |
ADC (Indirect,X) | 61 | 2 | 6 |
ADC (Indirect),Y | 71 | 2 | 5* |
AND #Immediate | 29 | 2 | 2 |
AND ZeroPage | 25 | 2 | 3 |
AND ZeroPage,X | 35 | 2 | 4 |
AND Absolute | 2D | 3 | 4 |
AND Absolute,X | 3D | 3 | 4* |
AND Absolute,Y | 39 | 3 | 4* |
AND (Indirect,X) | 21 | 2 | 6 |
AND (Indirect),Y | 31 | 2 | 5 |
ASL A | 0A | 1 | 2 |
ASL ZeroPage | 06 | 2 | 5 |
ASL ZeroPage,X | 16 | 2 | 6 |
ASL Absolute | 0E | 3 | 6 |
ASL Absolute,X | 1E | 3 | 7 |
BCC Relative | 90 | 2 | 2* |
BCS Relative | B0 | 2 | 2* |
BEQ Relative | F0 | 2 | 2* |
BIT ZeroPage | 24 | 2 | 3 |
BIT Absolute | 2C | 3 | 4 |
BMI Relative | 30 | 2 | 2* |
BNE Relative | D0 | 2 | 2* |
BPL Relative | 10 | 2 | 2* |
BRK | 00 | 1 | 7 |
BVC Relative | 50 | 2 | 2* |
BVS Relative | 70 | 2 | 2* |
CLC | 18 | 1 | 2 |
CLD | D8 | 1 | 2 |
CLI | 58 | 1 | 2 |
CLV | B8 | 1 | 2 |
CMP #Immediate | C9 | 2 | 2 |
CMP ZeroPage | C5 | 2 | 3 |
CMP ZeroPage,X | D5 | 2 | 4 |
CMP Absolute | CD | 3 | 4 |
CMP Absolute,X | DD | 3 | 4* |
CMP Absolute,Y | D9 | 3 | 4* |
CMP (Indirect,X) | C1 | 2 | 6 |
CMP (Indirect),Y | D1 | 2 | 5* |
CPX #Immediate | E0 | 2 | 2 |
CPX ZeroPage | E4 | 2 | 3 |
CPX Absolute | EC | 3 | 4 |
CPY #Immediate | C0 | 2 | 2 |
CPY ZeroPage | C4 | 2 | 3 |
CPY Absolute | CC | 3 | 4 |
DEC ZeroPage | C6 | 2 | 5 |
DEC ZeroPage,X | D6 | 2 | 6 |
DEC Absolute | CE | 3 | 6 |
DEC Absolute,X | DE | 3 | 7 |
DEX | CA | 1 | 2 |
DEY | 88 | 1 | 2 |
EOR #Immediate | 49 | 2 | 2 |
EOR ZeroPage | 45 | 2 | 3 |
EOR ZeroPage,X | 55 | 2 | 4 |
EOR Absolute | 40 | 3 | 4 |
EOR Absolute,X | 50 | 3 | 4* |
EOR Absolute,Y | 59 | 3 | 4* |
EOR (Indirect,X) | 41 | 2 | 6 |
EOR (Indirect),Y | 51 | 2 | 5* |
INC ZeroPage | E6 | 2 | 5 |
INC ZeroPage,X | F6 | 2 | 6 |
INC Absolute | EE | 3 | 6 |
INC Absolute,X | FE | 3 | 7 |
INX | E8 | 1 | 2 |
INY | C8 | 1 | 2 |
JMP Absolute | 4C | 3 | 3 |
JMP Indirect | 6C | 3 | 5 |
JSR Absolute | 20 | 3 | 6 |
LDA #Immediate | A9 | 2 | 2 |
LDA ZeroPage | A5 | 2 | 3 |
LDA ZeroPage,X | B5 | 2 | 4 |
LDA Absolute | AD | 3 | 4 |
LDA Absolute,X | BD | 3 | 4* |
LDA Absolute,Y | B9 | 3 | 4* |
LDA (Indirect,X) | A1 | 2 | 6 |
LDA (Indirect),Y | B1 | 2 | 5* |
LDA #Immediate | A2 | 2 | 2 |
LDA ZeroPage | A6 | 2 | 3 |
LDA ZeroPage,Y | B6 | 2 | 4 |
LDA Absolute | AE | 3 | 4 |
LDA Absolute,Y | BE | 3 | 4* |
LDY #Immediate | A0 | 2 | 2 |
LDY ZeroPage | A4 | 2 | 3 |
LDY ZeroPage,X | B4 | 2 | 4 |
LDY Absolute | AC | 3 | 4 |
LDY Absolute,X | BC | 3 | 4* |
LSR A | 4A | 1 | 2 |
LSR ZeroPage | 46 | 2 | 5 |
LSR ZeroPage,X | 56 | 2 | 6 |
LSR Absolute | 4E | 3 | 6 |
LSR Absolute,X | 5E | 3 | 7 |
NOP | EA | 1 | 2 |
ORA #Immediate | 09 | 2 | 2 |
ORA ZeroPage | 05 | 2 | 3 |
ORA ZeroPage,X | 15 | 2 | 4 |
ORA Absolute | 0D | 3 | 4 |
ORA Absolute,X | 1D | 3 | 4* |
ORA Absolute,Y | 19 | 3 | 4* |
ORA (Indirect,X) | 01 | 2 | 6 |
ORA (Indirect),Y | 11 | 2 | 5 |
PHA | 48 | 1 | 3 |
PHP | 08 | 1 | 3 |
PLA | 68 | 1 | 4 |
PLP | 28 | 1 | 4 |
ROR A | 2A | 1 | 2 |
ROL ZeroPage | 26 | 2 | 5 |
ROL ZeroPage,X | 36 | 2 | 6 |
ROL Absolute | 2E | 3 | 6 |
ROL Absolute,X | 3E | 3 | 7 |
ROR A | 6A | 1 | 2 |
ROR ZeroPage | 66 | 2 | 5 |
ROR ZeroPage,X | 76 | 2 | 6 |
ROR Absolute | 6E | 3 | 6 |
ROR Absolute,X | 7E | 3 | 7 |
RTI | 4D | 1 | 6 |
RTS | 60 | 1 | 6 |
SBC #Immediate | E9 | 2 | 2 |
SBC ZeroPage | E5 | 2 | 3 |
SBC ZeroPage,X | F5 | 2 | 4 |
SBC Absolute | ED | 3 | 4 |
SBC Absolute,X | FD | 3 | 4* |
SBC Absolute,Y | F9 | 3 | 4* |
SBC (Indirect,X) | E1 | 2 | 6 |
SBC (Indirect),Y | F1 | 2 | 5 |
SEC | 38 | 1 | 2 |
SED | F8 | 1 | 2 |
SEI | 78 | 1 | 2 |
STA ZeroPage | 85 | 2 | 3 |
STA ZeroPage,X | 95 | 2 | 4 |
STA Absolute | 80 | 3 | 4 |
STA Absolute,X | 90 | 3 | 5 |
STA Absolute,Y | 99 | 3 | 5 |
STA (Indirect,X) | 81 | 2 | 6 |
STA (Indirect),Y | 91 | 2 | 6 |
STX ZeroPage | 86 | 2 | 3 |
STX ZeroPage,Y | 96 | 2 | 4 |
STX Absolute | 8E | 3 | 4 |
STY ZeroPage | 84 | 2 | 3 |
STY ZeroPage,X | 94 | 2 | 4 |
STY Absolute | 8C | 3 | 4 |
TAX | AA | 1 | 2 |
TAY | A8 | 1 | 2 |
TSX | BA | 1 | 2 |
TXA | 8A | 1 | 2 |
TXS | 9A | 1 | 2 |
TYA | 98 | 1 | 2 |