Mnemonic /
Instruction |
Mode |
Opcode |
Function |
Updated flags |
ADC: ADd to
Accumulator with Carry |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
69
65
75
6D
7D
79
61
71 |
A,C <= A + M + C |
N Z C V |
AND: Logical And
of
Memory and Accumulator |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
29
25
35
2D
3D
39
21
31 |
A <= A and M |
N Z |
ASL: Arithmetic Shift
Left |
Accumulator
Zero Page
Zero Page,X
Absolute
Absolute,X |
0A
06
16
0E
1E |
A <= A * 2 (Accumulator) M <= M * 2 (Other modes) |
N Z C |
BCC: Branch on
Carry Clear |
Relative |
90 |
Branches if C=0 |
none |
BCS: Branch on Carry
Set |
Relative |
B0 |
Branches if C=1 |
none |
BEQ: Branch if Equal |
Relative |
F0 |
Branches if Z=1 |
none |
BIT: Test Bits with
Accumulator |
Zero Page
Absolute |
24
2C |
N=M7, V=M6
Z=1 if A and M=0 |
N Z V |
BMI: Branch if Minus |
Relative |
30 |
Branches if N=1 |
none |
BNE: Branch if Not
Equal |
Relative |
D0 |
Branches if Z=0 |
none |
BPL: Branch if Plus |
Relative |
10 |
Branches if N=0 |
none |
BRK: Break |
Implied |
00 |
Forced Interrupt |
I |
BVC: Branch on Overflow
Clear |
Relative |
50 |
Branches if V=0 |
none |
BVS: Branch on Overflow
Set |
Relative |
70 |
Branches if V=1 |
none |
CLC: Clear Carry
Flag |
Implied |
18 |
C <= 0 |
C |
CLD: Clear Decimal
Mode |
Implied |
D8 |
D <= 0 |
D |
CLI: Clear Interrupt
Disable |
Implied |
58 |
I <= 0 |
I |
CLV: Clear Overflow
Flag |
Implied |
B8 |
V <= 0 |
V |
CMP: Compare
Memory and Accumulator |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
C9
C5
D5
CD
DD
D9
C1
D1 |
If A < M: N=1, Z=0, C=0
If A = M: N=0, Z=1, C=1
If A > M: N=0, Z=0, C=1 |
N Z C |
CPX: Compare
Memory and X reg. |
Immediate
Zero Page
Absolute |
E0
E4
EC |
If X < M: N=1, Z=0, C=0
If X = M: N=0, Z=1, C=1
If X > M: N=0, Z=0, C=1 |
N Z C |
CPY: Compare
Memory and Y reg. |
Immediate
Zero Page
Absolute |
C0
C4
CC |
If Y < M: N=1, Z=0, C=0
If Y = M: N=0, Z=1, C=1
If Y > M: N=0, Z=0, C=1 |
N Z C |
DEC: Decrement
Memory by One |
Zero Page
Zero Page,X
Absolute
Absolute,X |
C6
D6
CE
DE |
M <= M -1 |
N Z |
DEX: Decrement X |
Implied |
CA |
X <= X - 1 |
N Z |
DEY: Decrement Y |
Implied |
88 |
Y <= Y - 1 |
N Z |
EOR: Logical
Exclusive Or of
Memory and
Accumulator |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
49
45
55
4D
5D
59
41
51 |
A <= A xor M |
N Z |
INC: Increment
Memory by One |
Zero Page
Zero Page,X
Absolute
Absolute,X |
E6
F6
EE
FE |
M <= M + 1 |
N Z |
INX: Increment X |
Implied |
E8 |
X <= X + 1 |
N Z |
INY: Increment Y |
Implied |
C8 |
Y <= Y + 1 |
NZ |
JMP: Jump |
Absolute
Indirect |
4C
6C |
Jumps to indicated position |
none |
JSR: Jump to Subroutine |
Absolute |
20 |
jumps to subroutine! |
none |
LDA: Load
Accumulator |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
A9
A5
B5
AD
BD
B9
A1
B1 |
A <= M |
N Z |
LDX: Load
X |
Immediate
Zero Page
Zero Page,Y
Absolute
Absolute,Y |
A2
A6
B6
AE
BE |
X <= M |
N Z |
LDY: Load
Y |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X |
A0
A4
B4
AC
BC |
Y <= M |
N Z |
LSR: Logical Shift
Right |
Accumulator
Zero Page
Zero Page,X
Absolute
Absolute,X |
4A
46
56
4E
5E |
A <= A / 2 (Accumulator) M <= M / 2 (outros modos) |
N Z C |
NOP: No Operation |
Implied |
EA |
What it does? It doesn't! |
none |
ORA: Logical Or
of Memory and Accumulator |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
09
05
15
0D
1D
19
01
11 |
A <= A or M |
N Z |
PHA: Push
Accumulator
on Stack |
Implied |
48 |
Stack <= A |
none |
PHP: Push
Processor
Status on Stack |
Implied |
08 |
Stack <= P |
none |
PLA: Pull
Accumulator
from Stack |
Implied |
68 |
A <= Stack |
N Z |
PLP: Pull
Processor
Status from Stack |
Implied |
28 |
P <= Stack |
todos |
ROL: Rotate Left |
Accumulator
Zero Page
Zero Page,X
Absolute
Absolute,X |
2A
26
36
2E
3E |
C <= M[7]
M[7] <= M[6]
...
M[1] <= M[0]
M[0] <= C
(Rotate A in Accumulator mode) |
N Z C |
ROR: Rotate Right |
Accumulator
Zero Page
Zero Page,X
Absolute
Absolute,X |
6A
66
76
6E
7E |
C => M[7]
M[7] => M[6]
...
M[1] => M[0]
M[0] => C
(Rotate A in Accumulator mode) |
N Z C |
RTI: Return
from Interrupt |
Implied |
40 |
Returns from interrupt! |
todos |
RTS: Return
from Subroutine |
Implied |
60 |
Returns from subroutine! |
none |
SBC: Subtract
from
Accumulator with Carry |
Immediate
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
E9
E5
F5
ED
FD
F9
E1
F1 |
A <= A - M - (not C) |
N Z C V |
SEC: Ift Carry
Flag |
Implied |
38 |
C <= 1 |
C |
SED: Ift Decimal
Mode |
Implied |
F8 |
D <= 1 |
D |
SEI: Ift Interrupt
Disable |
Implied |
78 |
I <= 1 |
I |
STA: Store Accumulator
In Memory |
Zero Page
Zero Page,X
Absolute
Absolute,X
Absolute,Y
(Indirect,X)
(Indirect),Y |
85
95
8D
9D
99
81
91 |
M <= A |
none |
STX: Store X
in Memory |
Zero Page
Zero Page,Y
Absolute |
86
96
8E |
M <= X |
none |
STY: Store Y
in Memory |
Zero Page
Zero Page,X
Absolute |
84
94
8C |
M <= Y |
none |
TAX: Transfer A
to X |
Implied |
AA |
X <= A |
N Z |
TAY: Transfer A
to Y |
Implied |
A8 |
Y <= A |
N Z |
TYA: Transfer Y
to A |
Implied |
98 |
A <= Y |
N Z |
TSX: Transfer S
to X |
Implied |
BA |
X <= S |
N Z |
TXA: Transfer X
to A |
Implied |
8A |
A <= X |
N Z |
TXS: Transfer X
to S |
Implied |
9A |
S <= X |
N Z |