§ Список инструкции 6502
76543210 | xxx000xx | xxx001xx | xxx010xx | xxx011xx | xxx100xx | xxx101xx | xxx110xx | xxx111xx |
000xxx00 | 00 BRK IMP | 04 DOP ZP | 08 PHP IMP | 0C TOP ABS | 10 BPL REL | 14 DOP ZPX | 18 CLC IMP | 1C TOP ABX |
001xxx00 | 20 JSR ABS | 24 BIT ZP | 28 PLP IMP | 2C BIT ABS | 30 BMI REL | 34 DOP ZPX | 38 SEC IMP | 3C TOP ABX |
010xxx00 | 40 RTI IMP | 44 DOP ZP | 48 PHA IMP | 4C JMP ABS | 50 BVC REL | 54 DOP ZPX | 58 CLI IMP | 5C TOP ABX |
011xxx00 | 60 RTS IMP | 64 DOP ZP | 68 PLA IMP | 6C JMP IND | 70 BVS REL | 74 DOP ZPX | 78 SEI IMP | 7C TOP ABX |
100xxx00 | 80 DOP IMM | 84 STY ZP | 88 DEY IMP | 8C STY ABS | 90 BCC REL | 94 STY ZPX | 98 TYA IMP | 9C SYA ABX |
101xxx00 | A0 LDY IMM | A4 LDY ZP | A8 TAY IMP | AC LDY ABS | B0 BCS REL | B4 LDY ZPX | B8 CLV IMP | BC LDY ABX |
110xxx00 | C0 CPY IMM | C4 CPY ZP | C8 INY IMP | CC CPY ABS | D0 BNE REL | D4 DOP ZPX | D8 CLD IMP | DC TOP ABX |
111xxx00 | E0 CPX IMM | E4 CPX ZP | E8 INX IMP | EC CPX ABS | F0 BEQ REL | F4 DOP ZPX | F8 SED IMP | FC TOP ABX |
000xxx01 | 01 ORA NDX | 05 ORA ZP | 09 ORA IMM | 0D ORA ABS | 11 ORA NDY | 15 ORA ZPX | 19 ORA ABY | 1D ORA ABX |
001xxx01 | 21 AND NDX | 25 AND ZP | 29 AND IMM | 2D AND ABS | 31 AND NDY | 35 AND ZPX | 39 AND ABY | 3D AND ABX |
010xxx01 | 41 EOR NDX | 45 EOR ZP | 49 EOR IMM | 4D EOR ABS | 51 EOR NDY | 55 EOR ZPX | 59 EOR ABY | 5D EOR ABX |
011xxx01 | 61 ADC NDX | 65 ADC ZP | 69 ADC IMM | 6D ADC ABS | 71 ADC NDY | 75 ADC ZPX | 79 ADC ABY | 7D ADC ABX |
100xxx01 | 81 STA NDX | 85 STA ZP | 89 DOP IMM | 8D STA ABS | 91 STA NDY | 95 STA ZPX | 99 STA ABY | 9D STA ABX |
101xxx01 | A1 LDA NDX | A5 LDA ZP | A9 LDA IMM | AD LDA ABS | B1 LDA NDY | B5 LDA ZPX | B9 LDA ABY | BD LDA ABX |
110xxx01 | C1 CMP NDX | C5 CMP ZP | C9 CMP IMM | CD CMP ABS | D1 CMP NDY | D5 CMP ZPX | D9 CMP ABY | DD CMP ABX |
111xxx01 | E1 SBC NDX | E5 SBC ZP | E9 SBC IMM | ED SBC ABS | F1 SBC NDY | F5 SBC ZPX | F9 SBC ABY | FD SBC ABX |
000xxx10 | 02 KIL | 06 ASL ZP | 0A ASL ACC | 0E ASL ABS | 12 KIL | 16 ASL ZPX | 1A NOP | 1E ASL ABX |
001xxx10 | 22 KIL | 26 ROL ZP | 2A ROL ACC | 2E ROL ABS | 32 KIL | 36 ROL ZPX | 3A NOP | 3E ROL ABX |
010xxx10 | 42 KIL | 46 LSR ZP | 4A LSR ACC | 4E LSR ABS | 52 KIL | 56 LSR ZPX | 5A NOP | 5E LSR ABX |
011xxx10 | 62 KIL | 66 ROR ZP | 6A ROR ACC | 6E ROR ABS | 72 KIL | 76 ROR ZPX | 7A NOP | 7E ROR ABX |
100xxx10 | 82 DOP IMM | 86 STX ZP | 8A TXA IMP | 8E STX ABS | 92 KIL | 96 STX ZPY | 9A TXS IMP | 9E SXA aby |
101xxx10 | A2 LDX IMM | A6 LDX ZP | AA TAX IMP | AE LDX ABS | B2 KIL | B6 LDX ZPY | BA TSX IMP | BE LDX ABX |
110xxx10 | C2 DOP IMM | C6 DEC ZP | CA DEX IMP | CE DEC ABS | D2 KIL | D6 DEC ZPX | DA NOP | DE DEC ABX |
111xxx10 | E2 DOP IMM | E6 INC ZP | EA NOP IMP | EE INC ABS | F2 KIL | F6 INC ZPX | FA NOP | FE INC ABX |
000xxx11 | 03 SLO NDX | 07 SLO ZP | 0B AAC IMM | 0F SLO ABS | 13 SLO NDY | 17 SLO ZPX | 1B SLO ABY | 1F SLO ABX |
001xxx11 | 23 RLA NDX | 27 RLA ZP | 2B AAC IMM | 2F RLA ABS | 33 RLA NDY | 37 RLA ZPX | 3B RLA ABY | 3F RLA ABX |
010xxx11 | 43 SRE NDX | 47 SRE ZP | 4B ASR IMM | 4F SRE ABS | 53 SRE NDY | 57 SRE ZPX | 5B SRE ABY | 5F SRE ABX |
011xxx11 | 63 RRA NDX | 67 RRA ZP | 6B ARR IMM | 6F RRA ABS | 73 RRA NDY | 77 RRA ZPX | 7B RRA ABY | 7F RRA ABX |
100xxx11 | 83 AAX NDX | 87 AAX ZP | 8B XAA IMM | 8F AAX ABS | 93 AXA NDY | 97 AAX ZPX | 9B XAS ABY | 9F AXA ABX |
101xxx11 | A3 LAX NDX | A7 LAX ZP | AB ATX IMM | AF LAX ABS | B3 LAX NDY | B7 LAX ZPY | BB LAR ABY | BF LAX ABY |
110xxx11 | C3 DCP NDX | C7 DCP ZP | CB AXS IMM | CF DCP ABS | D3 DCP NDY | D7 DCP ZPX | DB DCP ABY | DF DCP ABX |
111xxx11 | E3 ISC NDX | E7 ISC ZP | EB SBC IMM | EF ISC ABS | F3 ISC NDY | F7 ISC ZPX | FB ISC ABY | FF ISC ABX |
§ Базовые инструкции в виде таблицы
00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00 | BRK IMP | ORA NDX | ORA ZP | ASL ZP | PHP IMP | ORA IMM | ASL ACC | ORA ABS | ASL ABS | |||||||
10 | BPL REL | ORA NDY | ORA ZPX | ASL ZPX | CLC IMP | ORA ABY | ORA ABX | ASL ABX | ||||||||
20 | JSR ABS | AND NDX | BIT ZP | AND ZP | ROL ZP | PLP IMP | AND IMM | ROL ACC | BIT ABS | AND ABS | ROL ABS | |||||
30 | BMI REL | AND NDY | AND ZPX | ROL ZPX | SEC IMP | AND ABY | AND ABX | ROL ABX | ||||||||
40 | RTI IMP | EOR NDX | EOR ZP | LSR ZP | PHA IMP | EOR IMM | LSR ACC | JMP ABS | EOR ABS | LSR ABS | ||||||
50 | BVC REL | EOR NDY | EOR ZPX | LSR ZPX | CLI IMP | EOR ABY | EOR ABX | LSR ABX | ||||||||
60 | RTS IMP | ADC NDX | ADC ZP | ROR ZP | PLA IMP | ADC IMM | ROR ACC | JMP IND | ADC ABS | ROR ABS | ||||||
70 | BVS REL | ADC NDY | ADC ZPX | ROR ZPX | SEI IMP | ADC ABY | ADC ABX | ROR ABX | ||||||||
80 | STA NDX | STY ZP | STA ZP | STX ZP | DEY IMP | TXA IMP | STY ABS | STA ABS | STX ABS | |||||||
90 | BCC REL | STA NDY | STY ZPX | STA ZPX | STX ZPY | TYA IMP | STA ABY | TXS IMP | STA ABX | |||||||
A0 | LDY IMM | LDA NDX | LDX IMM | LDY ZP | LDA ZP | LDX ZP | TAY IMP | LDA IMM | TAX IMP | LDY ABS | LDA ABS | LDX ABS | ||||
B0 | BCS REL | LDA NDY | LDY ZPX | LDA ZPX | LDX ZPY | CLV IMP | LDA ABY | TSX IMP | LDY ABX | LDA ABX | LDX ABX | |||||
C0 | CPY IMM | CMP NDX | CPY ZP | CMP ZP | DEC ZP | INY IMP | CMP IMM | DEX IMP | CPY ABS | CMP ABS | DEC ABS | |||||
D0 | BNE REL | CMP NDY | CMP ZPX | DEC ZPX | CLD IMP | CMP ABY | CMP ABX | DEC ABX | ||||||||
E0 | CPX IMM | SBC NDX | CPX ZP | SBC ZP | INC ZP | INX IMP | SBC IMM | NOP IMP | CPX ABS | SBC ABS | INC ABS | |||||
F0 | BEQ REL | SBC NDY | SBC ZPX | INC ZPX | SED IMP | SBC ABY | SBC ABX | INC ABX |
§ Таблица инструкции опкодов и тактов к ним
IMM | ZP | ZPX | ZPY | ABS | ABSX | ABSY | I,X | I,Y | IMP | REL | ACC | IND | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ADC | 69 2T | 65 3T | 75 4T | 6D 4T | 7D 4*T | 79 4*T | 61 6T | 71 5*T | |||||
AND | 29 2T | 25 3T | 35 4T | 2D 4T | 3D 4*T | 39 4*T | 21 6T | 31 5*T | |||||
ASL | 06 5T | 16 6T | 0E 6T | 1E 7T | 0A 2T | ||||||||
BCC | 90 2**T | ||||||||||||
BCS | B0 2**T | ||||||||||||
BEQ | F0 2**T | ||||||||||||
BIT | 24 3T | 2C 4T | |||||||||||
BMI | 30 2**T | ||||||||||||
BNE | D0 2**T | ||||||||||||
BPL | 10 2**T | ||||||||||||
BRK | 00 7T | ||||||||||||
BVC | 50 2**T | ||||||||||||
BVS | 70 2**T | ||||||||||||
CLC | 18 2T | ||||||||||||
CLD | D8 2T | ||||||||||||
CLI | 58 2T | ||||||||||||
CLV | B8 2T | ||||||||||||
CMP | C9 2T | C5 3T | D5 4T | CD 4T | DD 4*T | D9 4*T | C1 6T | D1 5*T | |||||
CPX | E0 2T | E4 3T | EC 4T | ||||||||||
CPY | C0 2T | C4 3T | CC 4T | ||||||||||
DEC | C6 5T | D6 6T | CE 6T | DE 7T | |||||||||
DEX | CA 2T | ||||||||||||
DEY | 88 2T | ||||||||||||
EOR | 49 2T | 45 3T | 55 4T | 4D 4T | 5D 4*T | 59 4*T | 41 6T | 51 5*T | |||||
INC | E6 5T | F6 6T | EE 6T | FE 7T | |||||||||
INX | E8 2T | ||||||||||||
INY | C8 2T | ||||||||||||
JMP | 4C 3T | 6C 5T | |||||||||||
JSR | 20 6T | ||||||||||||
LDA | A9 2T | A5 3T | B5 4T | AD 4T | BD 4*T | B9 4*T | A1 6T | B1 5*T | |||||
LDX | A2 2T | A6 3T | B6 4T | AE 4T | BE 4*T | ||||||||
LDY | A0 2T | A4 3T | B4 4T | AC 4T | BC 4*T | ||||||||
LSR | 46 5T | 56 6T | 4E 6T | 5E 7T | 4A 2T | ||||||||
NOP | EA 2T | ||||||||||||
ORA | 09 2T | 05 3T | 15 4T | 0D 4T | 1D 4*T | 19 4*T | 01 6T | 11 5*T | |||||
PHA | 48 3T | ||||||||||||
PHP | 08 3T | ||||||||||||
PLA | 68 4T | ||||||||||||
PLP | 28 4T | ||||||||||||
ROL | 26 5T | 36 6T | 2E 6T | 3E 7T | 2A 2T | ||||||||
ROR | 66 5T | 76 6T | 6E 6T | 7E 7T | 6A 2T | ||||||||
RTI | 40 6T | ||||||||||||
RTS | 60 6T | ||||||||||||
SBC | E9 2T | E5 3T | F5 4T | ED 4T | FD 4*T | F9 4*T | E1 6T | F1 5*T | |||||
SEC | 38 2T | ||||||||||||
SED | F8 2T | ||||||||||||
SEI | 78 2T | ||||||||||||
STA | 85 3T | 95 4T | 8D 4T | 9D 5T | 99 5T | 81 6T | 91 6T | ||||||
STX | 86 3T | 96 4T | 8E 4T | ||||||||||
STY | 84 3T | 94 4T | 8C 4T | ||||||||||
TAX | AA 2T | ||||||||||||
TAY | A8 2T | ||||||||||||
TSX | BA 2T | ||||||||||||
TXA | 8A 2T | ||||||||||||
TXS | 9A 2T | ||||||||||||
TYA | 98 2T |