instruction |
mnemonic |
CC flags |
example |
op code |
bytes |
cycles |
address mode |
needs ea |
read from memory |
write to memory |
register |
ABX |
ABX |
----- |
X = B+X (Unsigned) |
$3a |
1 |
3 |
inherent |
no |
no |
no |
- |
ADC |
ADCA |
aaaaa |
A = A+M+C |
$89 |
2 |
2 |
immediate |
byte |
A |
$99 |
4 |
direct |
$a9 |
indexed |
$b9 |
3 |
5 |
extended |
ADCB |
B = B+M+C |
$c9 |
2 |
2 |
immediate |
B |
$d9 |
4 |
direct |
$e9 |
indexed |
$f9 |
3 |
5 |
extended |
ADD |
ADDA |
A = A+M |
$8b |
2 |
2 |
immediate |
A |
$9b |
4 |
direct |
$ab |
indexed |
$bb |
3 |
5 |
extended |
ADDB |
B = B+M |
$cb |
2 |
2 |
immediate |
B |
$db |
4 |
direct |
$eb |
indexed |
$fb |
3 |
5 |
extended |
ADDD |
-aaaa |
D = D+M:M+1 |
$c3 |
4 |
immediate word |
word |
D |
$d3 |
2 |
6 |
direct word |
$e3 |
indexed word |
$f3 |
3 |
7 |
extended word |
AND |
ANDA |
-aa0- |
A = A && M |
$84 |
2 |
2 |
immediate |
byte |
A |
$94 |
4 |
direct |
$a4 |
indexed |
$b4 |
3 |
5 |
extended |
ANDB |
B = B && M |
$c4 |
2 |
2 |
immediate |
B |
$d4 |
4 |
direct |
$e4 |
indexed |
$f4 |
3 |
5 |
extended |
ANDCC |
ddddd |
C = CC && IMM |
$1c |
2 |
3 |
immediate |
CC |
ASR |
ASR |
uaa-s |
M = Arithmetic shift M right |
$07 |
6 |
direct |
yes |
byte |
- |
$67 |
indexed |
$77 |
3 |
7 |
extended |
ASRA |
A = Arithmetic shift A right |
$47 |
1 |
2 |
inherent |
no |
no |
no |
A |
ASRB |
B = Arithmetic shift B right |
$57 |
B |
BEQ |
BEQ |
----- |
|
$27 |
2 |
3 |
relative |
yes |
- |
LBEQ |
$1027 |
4 |
5 |
relative word |
BGE |
BGE |
$2c |
2 |
3 |
relative |
LBGE |
$102c |
4 |
5 |
relative word |
BGT |
BGT |
$2e |
2 |
3 |
relative |
LBGT |
$102e |
4 |
5 |
relative word |
BHI |
BHI |
$22 |
2 |
3 |
relative |
LBHI |
$1022 |
4 |
5 |
relative word |
BHS |
BCC |
$24 |
2 |
3 |
relative |
LBCC |
$1024 |
4 |
5 |
relative word |
BIT |
BITA |
-aa0- |
Bit Test A (M&&A) |
$85 |
2 |
2 |
immediate |
no |
byte |
A |
$95 |
4 |
direct |
$a5 |
indexed |
$b5 |
3 |
5 |
extended |
BITB |
Bit Test B (M&&B) |
$c5 |
2 |
2 |
immediate |
B |
$d5 |
4 |
direct |
$e5 |
indexed |
$f5 |
3 |
5 |
extended |
BLE |
BLE |
----- |
|
$2f |
2 |
3 |
relative |
yes |
no |
- |
LBLE |
$102f |
4 |
5 |
relative word |
BLO |
BLO |
$25 |
2 |
3 |
relative |
LBCS |
$1025 |
4 |
5 |
relative word |
BLS |
BLS |
$23 |
2 |
3 |
relative |
LBLS |
$1023 |
4 |
5 |
relative word |
BLT |
BLT |
$2d |
2 |
3 |
relative |
LBLT |
$102d |
4 |
5 |
relative word |
BMI |
BMI |
$2b |
2 |
3 |
relative |
LBMI |
$102b |
4 |
5 |
relative word |
BNE |
BNE |
$26 |
2 |
3 |
relative |
LBNE |
$1026 |
4 |
5 |
relative word |
BPL |
BPL |
$2a |
2 |
3 |
relative |
LBPL |
$102a |
4 |
5 |
relative word |
BRA |
BRA |
$20 |
2 |
3 |
relative |
LBRA |
$16 |
3 |
5 |
relative word |
BRN |
BRN |
$21 |
2 |
3 |
relative |
LBRN |
$1021 |
4 |
5 |
relative word |
BSR |
BSR |
$8d |
2 |
7 |
relative |
LBSR |
$17 |
3 |
9 |
relative word |
BVC |
BVC |
$28 |
2 |
3 |
relative |
LBVC |
$1028 |
4 |
5 |
relative word |
BVS |
BVS |
$29 |
2 |
3 |
relative |
LBVS |
$1029 |
4 |
5 |
relative word |
CLR |
CLR |
-0100 |
M = 0 |
$0f |
2 |
6 |
direct |
byte |
$6f |
indexed |
$7f |
3 |
7 |
extended |
CLRA |
A = 0 |
$4f |
1 |
2 |
inherent |
no |
no |
A |
CLRB |
B = 0 |
$5f |
B |
CMP |
CMPA |
uaaaa |
Compare M from A |
$81 |
2 |
immediate |
byte |
A |
$91 |
4 |
direct |
$a1 |
indexed |
$b1 |
3 |
5 |
extended |
CMPB |
Compare M from B |
$c1 |
2 |
2 |
immediate |
B |
$d1 |
4 |
direct |
$e1 |
indexed |
$f1 |
3 |
5 |
extended |
CMPD |
-aaaa |
Compare M:M+1 from D |
$1083 |
4 |
immediate word |
word |
D |
$1093 |
3 |
7 |
direct word |
$10a3 |
indexed word |
$10b3 |
4 |
8 |
extended word |
CMPS |
Compare M:M+1 from S |
$118c |
5 |
immediate word |
S |
$119c |
3 |
7 |
direct word |
$11ac |
indexed word |
$11bc |
4 |
8 |
extended word |
CMPU |
Compare M:M+1 from U |
$1183 |
5 |
immediate word |
U |
$1193 |
3 |
7 |
direct word |
$11a3 |
indexed word |
$11b3 |
4 |
8 |
extended word |
CMPX |
Compare M:M+1 from X |
$8c |
3 |
4 |
immediate word |
X |
$9c |
2 |
6 |
direct word |
$ac |
indexed word |
$bc |
3 |
7 |
extended word |
CMPY |
Compare M:M+1 from Y |
$108c |
4 |
5 |
immediate word |
Y |
$109c |
3 |
7 |
direct word |
$10ac |
indexed word |
$10bc |
4 |
8 |
extended word |
COM |
COM |
-aa01 |
M = complement(M) |
$03 |
2 |
6 |
direct |
yes |
byte |
byte |
- |
$63 |
indexed |
$73 |
3 |
7 |
extended |
COMA |
A = complement(A) |
$43 |
1 |
2 |
inherent |
no |
no |
no |
A |
COMB |
B = complement(B) |
$53 |
B |
CWAI |
CWAI |
ddddd |
CC = CC ^ IMM; (Wait for Interrupt) |
$3c |
2 |
21 |
immediate |
byte |
- |
DAA |
DAA |
-aa0a |
Decimal Adjust A |
$19 |
1 |
2 |
inherent |
no |
DEC |
DEC |
-aaa- |
M = M - 1 |
$0a |
2 |
6 |
direct |
yes |
byte |
byte |
$6a |
indexed |
$7a |
3 |
7 |
extended |
DECA |
A = A - 1 |
$4a |
1 |
2 |
inherent |
no |
no |
no |
A |
DECB |
B = B - 1 |
$5a |
B |
EOR |
EORA |
-aa0- |
A = A XOR M |
$88 |
2 |
immediate |
byte |
A |
$98 |
4 |
direct |
$a8 |
indexed |
$b8 |
3 |
5 |
extended |
EORB |
B = M XOR B |
$c8 |
2 |
2 |
immediate |
B |
$d8 |
4 |
direct |
$e8 |
indexed |
$f8 |
3 |
5 |
extended |
EXG |
EXG |
ccccc |
exchange R1,R2 |
$1e |
2 |
8 |
immediate |
- |
INC |
INC |
-aaa- |
M = M + 1 |
$0c |
6 |
direct |
yes |
byte |
$6c |
indexed |
$7c |
3 |
7 |
extended |
INCA |
A = A + 1 |
$4c |
1 |
2 |
inherent |
no |
no |
no |
A |
INCB |
B = B + 1 |
$5c |
B |
JMP |
JMP |
----- |
pc = EA |
$0e |
2 |
3 |
direct |
yes |
- |
$6e |
indexed |
$7e |
3 |
extended |
JSR |
JSR |
jump to subroutine |
$9d |
2 |
7 |
direct |
$ad |
indexed |
$bd |
3 |
8 |
extended |
LD |
LDA |
-aa0- |
A = M |
$86 |
2 |
2 |
immediate |
no |
byte |
A |
$96 |
4 |
direct |
$a6 |
indexed |
$b6 |
3 |
5 |
extended |
LDB |
B = M |
$c6 |
2 |
2 |
immediate |
B |
$d6 |
4 |
direct |
$e6 |
indexed |
$f6 |
3 |
5 |
extended |
LDD |
D = M:M+1 |
$cc |
3 |
immediate word |
word |
D |
$dc |
2 |
5 |
direct word |
$ec |
indexed word |
$fc |
3 |
6 |
extended word |
LDS |
S = M:M+1 |
$10ce |
4 |
4 |
immediate word |
S |
$10de |
3 |
6 |
direct word |
$10ee |
indexed word |
$10fe |
4 |
7 |
extended word |
LDU |
U = M:M+1 |
$ce |
3 |
3 |
immediate word |
U |
$de |
2 |
5 |
direct word |
$ee |
indexed word |
$fe |
3 |
6 |
extended word |
LDX |
X = M:M+1 |
$8e |
3 |
immediate word |
X |
$9e |
2 |
5 |
direct word |
$ae |
indexed word |
$be |
3 |
6 |
extended word |
LDY |
Y = M:M+1 |
$108e |
4 |
4 |
immediate word |
Y |
$109e |
3 |
6 |
direct word |
$10ae |
indexed word |
$10be |
4 |
7 |
extended word |
LEA |
LEAS |
----- |
S = EA |
$32 |
2 |
4 |
indexed |
yes |
no |
S |
LEAU |
U = EA |
$33 |
U |
LEAX |
--a-- |
X = EA |
$30 |
X |
LEAY |
Y = EA |
$31 |
Y |
LSL |
LSL |
naaas |
M = Logical shift M left |
$08 |
6 |
direct |
byte |
byte |
- |
$68 |
indexed |
$78 |
3 |
7 |
extended |
LSLA |
A = Logical shift A left |
$48 |
1 |
2 |
inherent |
no |
no |
no |
A |
LSLB |
B = Logical shift B left |
$58 |
B |
LSR |
LSR |
-0a-s |
M = Logical shift M right |
$04 |
2 |
6 |
direct |
yes |
byte |
byte |
- |
$64 |
indexed |
$74 |
3 |
7 |
extended |
LSRA |
A = Logical shift A right |
$44 |
1 |
2 |
inherent |
no |
no |
no |
A |
LSRB |
B = Logical shift B right |
$54 |
B |
MUL |
MUL |
--a-a |
D = A*B (Unsigned) |
$3d |
11 |
- |
NEG |
NEG |
uaaaa |
M = !M + 1 |
$00 |
2 |
6 |
direct |
yes |
byte |
byte |
$60 |
indexed |
$70 |
3 |
7 |
extended |
NEGA |
A = !A + 1 |
$40 |
1 |
2 |
inherent |
no |
no |
no |
A |
NEGB |
B = !B + 1 |
$50 |
B |
NOP |
NOP |
----- |
No Operation |
$12 |
- |
OR |
ORA |
-aa0- |
A = A || M |
$8a |
2 |
immediate |
byte |
A |
$9a |
4 |
direct |
$aa |
indexed |
$ba |
3 |
5 |
extended |
ORB |
B = B || M |
$ca |
2 |
2 |
immediate |
B |
$da |
4 |
direct |
$ea |
indexed |
$fa |
3 |
5 |
extended |
ORCC |
ddddd |
C = CC || IMM |
$1a |
2 |
3 |
immediate |
CC |
PAGE |
PAGE 1 |
+++++ |
Page 1 Instructions prefix |
$10 |
1 |
1 |
None |
no |
- |
PAGE 2 |
Page 2 Instructions prefix |
$11 |
PSH |
PSHS |
----- |
S -= 1: MEM(S) = R; Push Register on S Stack |
$34 |
2 |
5 |
immediate |
byte |
S |
PSHU |
U -= 1: MEM(U) = R; Push Register on U Stack |
$36 |
U |
PUL |
PULS |
ccccc |
R=MEM(S) : S += 1; Pull register from S Stack |
$35 |
S |
PULU |
R=MEM(U) : U += 1; Pull register from U Stack |
$37 |
U |
RESET |
RESET |
***** |
Undocumented opcode |
$3e |
1 |
-1 |
None |
no |
- |
ROL |
ROL |
-aaas |
M = Rotate M left thru carry |
$09 |
2 |
6 |
direct |
yes |
byte |
byte |
$69 |
indexed |
$79 |
3 |
7 |
extended |
ROLA |
A = Rotate A left thru carry |
$49 |
1 |
2 |
inherent |
no |
no |
no |
A |
ROLB |
B = Rotate B left thru carry |
$59 |
B |
ROR |
ROR |
-aa-s |
M = Rotate M Right thru carry |
$06 |
2 |
6 |
direct |
yes |
byte |
byte |
- |
$66 |
indexed |
$76 |
3 |
7 |
extended |
RORA |
A = Rotate A Right thru carry |
$46 |
1 |
2 |
inherent |
no |
no |
no |
A |
RORB |
B = Rotate B Right thru carry |
$56 |
B |
RTI |
RTI |
----- |
Return from Interrupt |
$3b |
6 |
- |
RTS |
RTS |
Return from subroutine |
$39 |
5 |
SBC |
SBCA |
uaaaa |
A = A - M - C |
$82 |
2 |
2 |
immediate |
byte |
A |
$92 |
4 |
direct |
$a2 |
indexed |
$b2 |
3 |
5 |
extended |
SBCB |
B = B - M - C |
$c2 |
2 |
2 |
immediate |
B |
$d2 |
4 |
direct |
$e2 |
indexed |
$f2 |
3 |
5 |
extended |
SEX |
SEX |
-aa0- |
Sign extend B into A |
$1d |
1 |
2 |
inherent |
no |
- |
ST |
STA |
M = A |
$97 |
2 |
4 |
direct |
yes |
byte |
A |
$a7 |
indexed |
$b7 |
3 |
5 |
extended |
STB |
M = B |
$d7 |
2 |
4 |
direct |
B |
$e7 |
indexed |
$f7 |
3 |
5 |
extended |
STD |
M:M+1 = D |
$dd |
2 |
direct |
word |
D |
$ed |
indexed |
$fd |
3 |
6 |
extended |
STS |
M:M+1 = S |
$10df |
direct |
S |
$10ef |
indexed |
$10ff |
4 |
7 |
extended |
STU |
M:M+1 = U |
$df |
2 |
5 |
direct |
U |
$ef |
indexed |
$ff |
3 |
6 |
extended |
STX |
M:M+1 = X |
$9f |
2 |
5 |
direct |
X |
$af |
indexed |
$bf |
3 |
6 |
extended |
STY |
M:M+1 = Y |
$109f |
direct |
Y |
$10af |
indexed |
$10bf |
4 |
7 |
extended |
SUB |
SUBA |
uaaaa |
A = A - M |
$80 |
2 |
2 |
immediate |
no |
byte |
no |
A |
$90 |
4 |
direct |
$a0 |
indexed |
$b0 |
3 |
5 |
extended |
SUBB |
B = B - M |
$c0 |
2 |
2 |
immediate |
B |
$d0 |
4 |
direct |
$e0 |
indexed |
$f0 |
3 |
5 |
extended |
SUBD |
-aaaa |
D = D - M:M+1 |
$83 |
4 |
immediate word |
word |
D |
$93 |
2 |
6 |
direct word |
$a3 |
indexed word |
$b3 |
3 |
7 |
extended word |
SWI |
SWI |
----- |
Software interrupt 1 |
$3f |
1 |
19 |
inherent |
no |
- |
SWI2 |
Software interrupt 2 |
$103f |
2 |
20 |
SWI3 |
Software interrupt 3 |
$113f |
SYNC |
SYNC |
Synchronize to Interrupt |
$13 |
1 |
2 |
TFR |
TFR |
ccccc |
|
$1f |
2 |
7 |
immediate |
byte |
TST |
TST |
-aa0- |
Test M |
$0d |
6 |
direct |
$6d |
indexed |
$7d |
3 |
7 |
extended |
TSTA |
Test A |
$4d |
1 |
2 |
inherent |
no |
A |
TSTB |
Test B |
$5d |
B |