Splitting the Atom |
|
page 72 |
Appendix 3. 6502 Assembler and
Machine code
MNEMONIC |
ABS |
ZP |
ABS, X |
ZP, X |
IMM |
(IND, X) |
ABS, Y |
(IND), Y |
ACC. |
ZP, Y |
(IND) |
|
ORA |
0D |
05 |
1D |
15 |
09 |
01 |
19 |
11 |
|
|
|
Logic
and math |
AND |
2D |
25 |
3D |
35 |
29 |
21 |
39 |
31 |
|
|
|
EOR |
4D |
45 |
5D |
55 |
49 |
41 |
59 |
51 |
|
|
|
ADC |
6D |
65 |
7D |
75 |
69 |
61 |
79 |
71 |
|
|
|
STA |
8D |
85 |
9D |
95 |
|
81 |
99 |
91 |
|
|
|
LDA |
AD |
A5 |
BD |
B5 |
A9 |
A1 |
B9 |
B1 |
|
|
|
CMP |
CD |
C5 |
DD |
D5 |
C9 |
C1 |
D9 |
D1 |
|
|
|
SBC |
ED |
E5 |
FD |
F5 |
E9 |
E1 |
F9 |
F1 |
|
|
|
ASL |
0E |
06 |
1E |
16 |
|
|
|
|
0A |
|
|
Shift and
Rotate |
ROL |
2E |
26 |
3E |
36 |
|
|
|
|
2A |
|
|
LSR |
4E |
46 |
5E |
56 |
|
|
|
|
4A |
|
|
ROR |
6E |
66 |
7E |
76 |
|
|
|
|
6A |
|
|
DEC |
CE |
C6 |
DE |
D6 |
|
|
|
|
|
|
|
Dec/Inc
Acc. |
INC |
EE |
E6 |
FE |
F6 |
|
|
|
|
|
|
|
LDY |
AC |
A4 |
BC |
B4 |
A0 |
|
|
|
|
|
|
Load / Store
index regs |
LDX |
AE |
A6 |
|
|
A2 |
|
BE |
|
|
B6 |
|
STY |
8C |
84 |
|
94 |
|
|
|
|
|
|
|
STX |
8E |
86 |
|
|
|
|
|
|
|
96 |
|
CPX |
EC |
E4 |
|
|
E0 |
|
|
|
|
|
|
Compare
index regs |
CPY |
CC |
C4 |
|
|
C0 |
|
|
|
|
|
|
BIT |
2C |
24 |
|
|
|
|
|
|
|
|
|
Bit test |
JMP |
4C |
|
|
|
|
|
|
|
|
|
6C |
Program flow |
JSR |
20 |
|
|
|
|
|
|
|
|
|
|
Branches
MNEMONIC |
REL |
|
BPL |
10 |
Branches |
BMI |
30 |
BVC |
50 |
BVS |
70 |
BCC |
90 |
BCS |
B0 |
BNE |
D0 |
BEQ |
F0 |
BRN |
80 |
Branch Never (6502 undocumented) |
BRA |
Branch Always (65C02) |
Implied
MNEMONIC |
IMP. |
|
DEX |
CA |
Dec/Inc
index regs |
DEY |
88 |
INX |
E8 |
INY |
C8 |
PHA |
48 |
Stack ops |
PHP |
08 |
PLA |
68 |
PLP |
28 |
RTI |
40 |
Return |
RTS |
60 |
TAX |
AA |
Register
transfers |
TAY |
A8 |
TSX |
BA |
TXA |
8A |
TXS |
9A |
TYA |
98 |
CLC |
18 |
Clear / Set
flags |
SEC |
38 |
CLD |
D8 |
SED |
F8 |
CLI |
58 |
SEI |
78 |
CLV |
B8 |
BRK |
00 |
|
NOP |
EA |
Erratum: Original text said EOR POST,Y = NONE. This
is not true.
6502 Op Codes (for disassembly)
\ LSD
MSD \ |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
LSD /
/ MSD |
0 |
BRK |
ORA
(IND,X) |
JAM |
SRA
(IND,X) |
NOP
ZP |
ORA
ZP |
ASL
ZP |
SRA
ZP |
PHP |
ORA
IMM |
ASL
A |
ANC
IMM |
NOP
ABS |
ORA
ABS |
ASL
ABS |
SRA
ABS |
0 |
1 |
BPL |
ORA
(IND),Y |
JAM |
SRA
(IND),Y |
NOP
ZP,X |
ORA
ZP,X |
ASL
ZP,X |
SRA
ZP,X |
CLC |
ORA
ABS,Y |
NOP |
SRA
ABS,Y |
NOP
ABS,X |
ORA
ABS,X |
ASL
ABS,X |
SRA
ABS,X |
1 |
2 |
JSR
ABS |
AND
(IND,X) |
JAM |
RLA
(IND,X) |
BIT
ZP |
AND
ZP |
ROL
ZP |
RLA
ZP |
PLP |
AND
IMM |
ROL
A |
ANC
IMM |
BIT
ABS |
AND
ABS |
ROL
ABS |
RLA
ABS |
2 |
3 |
BMI |
AND
(IND),Y |
JAM |
RLA
(IND),Y |
NOP
ZP,X |
AND
ZP,X |
ROL
ZP,X |
RLA
ZP,X |
SEC |
AND
ABS,Y |
NOP |
RLA
ABS,Y |
NOP
ABS,X |
AND
ABS,X |
ROL
ABS,X |
RLA
ABS,X |
3 |
4 |
RTI |
EOR
(IND,X) |
JAM |
SLO
(IND,X) |
NOP
ZP |
EOR
ZP |
LSR
ZP |
SLO
ZP |
PHA |
EOR
IMM |
LSR
A |
ASR
IMM |
JMP
ABS |
EOR
ABS |
LSR
ABS |
SLO
ABS |
4 |
5 |
BVC |
EOR
(IND),Y |
JAM |
SLO
(IND),Y |
NOP
ZP,X |
EOR
ZP,X |
LSR
ZP,X |
SLO
ZP,X |
CLI |
EOR
ABS,Y |
NOP |
SLO
ABS,Y |
NOP
ABS,X |
EOR
ABS,X |
LSR
ABS,X |
SLO
ABS,X |
5 |
6 |
RTS |
ADC
(IND,X) |
JAM |
RRA
(IND,X) |
NOP
ZP |
ADC
ZP |
ROR
ZP |
RRA
ZP |
PLA |
ADC
IMM |
ROR
A |
ARR
IMM |
JMP
Indirect |
ADC
ABS |
ROR
ABS |
RRA
ABS |
6 |
7 |
BVS |
ADC
(IND),Y |
JAM |
RRA
(IND),Y |
NOP
ZP,X |
ADC
ZP,X |
ROR
ZP,X |
RRA
ZP,X |
SEI |
ADC
ABS,Y |
NOP |
RRA
ABS,Y |
NOP
ABS,X |
ADC
ABS,X |
ROR
ABS,X |
RRA
ABS,X |
7 |
8 |
|
STA
(IND,X) |
NOP
IMM |
SAX
(IND,X) |
STY
ZP |
STA
ZP |
STX
ZP |
SAX
ZP |
DEY |
NOP
IMM |
TXA |
AXE
IMM |
STY
ABS |
STA
ABS |
STX
ABS |
SAX
ABS |
8 |
9 |
BCC |
STA
(IND),Y |
JAM |
AX7
(IND),Y |
STY
ZP,X |
STA
ZP,X |
STX
ZP,Y |
SA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