Beruflich Dokumente
Kultur Dokumente
ADC
ADC
ADC
ADC
ADC
ADC
ADC
ADC
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
ADD
ADD
ADD
ADD
ADD
ADD
ADD
ADD
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
Operation
Object Code
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A9
B9
C9
D9
E9
F9
9E D9
9E E9
ii
dd
hh ll
ee ff
ff
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
AB
BB
CB
DB
EB
FB
9E DB
9E EB
ii
dd
hh ll
ee ff
ff
ee ff
ff
ee ff
ff
Cycles
Source
Form
Address
Mode
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
1 1
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
1 1
AIS #opr8i
IMM
A7 ii
pp
1 1
AIX #opr8i
IMM
AF ii
pp
1 1
Logical AND
A (A) & (M)
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A4
B4
C4
D4
E4
F4
9E D4
9E E4
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
DIR
INH
INH
IX1
IX
SP1
38 dd
48
58
68 ff
78
9E 68 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
DIR
INH
INH
IX1
IX
SP1
37 dd
47
57
67 ff
77
9E 67 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
REL
24 rr
pdp
1 1
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
11
13
15
17
19
1B
1D
1F
4
4
4
4
4
4
4
4
prwp
prwp
prwp
prwp
prwp
prwp
prwp
prwp
1 1
AND
AND
AND
AND
AND
AND
AND
AND
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
ASL opr8a
ASLA
ASLX
ASL oprx8,X
ASL ,X
ASL oprx8,SP
ASR opr8a
ASRA
ASRX
ASR oprx8,X
ASR ,X
ASR oprx8,SP
BCC rel
BCLR n,opr8a
0
b7
b0
(Same as LSL)
Arithmetic Shift Right
C
b7
b0
ii
dd
hh ll
ee ff
ff
ee ff
ff
dd
dd
dd
dd
dd
dd
dd
dd
Freescale Semiconductor
Operation
Object Code
Cycles
Source
Form
Address
Mode
REL
25 rr
pdp
1 1
BEQ rel
REL
27 rr
pdp
1 1
BGE rel
REL
90 rr
pdp
1 1
BGT rel
REL
92 rr
pdp
1 1
BCS rel
BHCC rel
REL
28 rr
pdp
1 1
BHCS rel
REL
29 rr
pdp
1 1
BHI rel
REL
22 rr
pdp
1 1
BHS rel
REL
24 rr
pdp
1 1
BIH rel
REL
2F rr
pdp
1 1
BIL rel
REL
2E rr
pdp
1 1
Bit Test
(A) & (M)
(CCR Updated but Operands Not Changed)
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
pdp
1 1
BIT
BIT
BIT
BIT
BIT
BIT
BIT
BIT
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
BLE rel
REL
A5
B5
C5
D5
E5
F5
9E D5
9E E5
ii
dd
hh ll
ee ff
ff
ee ff
ff
93 rr
BLO rel
REL
25 rr
pdp
1 1
BLS rel
REL
23 rr
pdp
1 1
BLT rel
REL
91 rr
pdp
1 1
BMC rel
REL
2C rr
pdp
1 1
BMI rel
REL
2B rr
pdp
1 1
BMS rel
REL
2D rr
pdp
1 1
BNE rel
REL
26 rr
pdp
1 1
BPL rel
REL
2A rr
pdp
1 1
BRA rel
REL
20 rr
pdp
1 1
BRCLR n,opr8a,rel
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
01
03
05
07
09
0B
0D
0F
5
5
5
5
5
5
5
5
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
1 1
BRN rel
REL
21 rr
pdp
1 1
dd
dd
dd
dd
dd
dd
dd
dd
rr
rr
rr
rr
rr
rr
rr
rr
51
Addressing Modes
Operation
Object Code
5
5
5
5
5
5
5
5
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
prpdp
1 1
dd
dd
dd
dd
dd
dd
dd
dd
4
4
4
4
4
4
4
4
prwp
prwp
prwp
prwp
prwp
prwp
prwp
prwp
1 1
AD rr
pssp
1 1
5
4
4
5
4
6
pprdp
ppdp
ppdp
pprdp
prdp
ppprdp
1 1
1 1 0
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
00
02
04
06
08
0A
0C
0E
dd
dd
dd
dd
dd
dd
dd
dd
BSET n,opr8a
DIR (b0)
DIR (b1)
DIR (b2)
DIR (b3)
DIR (b4)
DIR (b5)
DIR (b6)
DIR (b7)
10
12
14
16
18
1A
1C
1E
BSR rel
Branch to Subroutine
PC (PC) + $0002
push (PCL); SP (SP) $0001
push (PCH); SP (SP) $0001
PC (PC) + rel
REL
BRSET n,opr8a,rel
CBEQ opr8a,rel
CBEQA #opr8i,rel
CBEQX #opr8i,rel
CBEQ oprx8,X+,rel
CBEQ ,X+,rel
CBEQ oprx8,SP,rel
Compare and...
CLC
CLI
CLR opr8a
CLRA
CLRX
CLRH
CLR oprx8,X
CLR ,X
CLR oprx8,SP
Clear
CMP
CMP
CMP
CMP
CMP
CMP
CMP
CMP
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
M $00
A $00
X $00
H $00
M $00
M $00
M $00
DIR
IMM
IMM
IX1+
IX+
SP1
INH
Affect on CCR
Cyc-by-Cyc
Details
V11H INZC
Cycles
Source
Form
Address
Mode
31
41
51
61
71
9E 61
dd
ii
ii
ff
rr
ff
rr
rr
rr
rr
rr
rr
rr
rr
rr
rr
rr
rr
rr
98
INH
9A
pd
1 1 0
DIR
INH
INH
INH
IX1
IX
SP1
3F dd
4F
5F
8C
6F ff
7F
9E 6F ff
3
1
1
1
3
2
4
pwp
p
p
p
ppw
pw
pppw
0 1 1 0 1
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A1
B1
C1
D1
E1
F1
9E D1
9E E1
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
1 1
33 dd
43
53
63 ff
73
9E 63 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
0 1 1
3
4
ppp
prrp
COM opr8a
COMA
COMX
COM oprx8,X
COM ,X
COM oprx8,SP
Complement
M (M)= $FF (M)
(Ones Complement) A (A) = $FF (A)
X (X) = $FF (X)
M (M) = $FF (M)
M (M) = $FF (M)
M (M) = $FF (M)
DIR
INH
INH
IX1
IX
SP1
CPHX #opr
CPHX opr
IMM
DIR
ii
dd
hh ll
ee ff
ff
ee ff
ff
65 ii jj
75 dd
1 1
Freescale Semiconductor
CPX
CPX
CPX
CPX
CPX
CPX
CPX
CPX
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
Operation
IMM
DIR
EXT
Compare X (Index Register Low) with Memory
IX2
XM
IX1
(CCR Updated But Operands Not Changed)
IX
SP2
SP1
Object Code
A3
B3
C3
D3
E3
F3
9E D3
9E E3
DAA
INH
72
DBNZ opr8a,rel
DBNZA rel
DBNZX rel
DBNZ oprx8,X,rel
DBNZ ,X,rel
DBNZ oprx8,SP,rel
DIR
INH
Decrement A, X, or M and Branch if Not Zero
INH
(if (result) 0)
IX1
DBNZX Affects X Not H
IX
SP1
3B
4B
5B
6B
7B
9E 6B
DEC opr8a
DECA
DECX
DEC oprx8,X
DEC ,X
DEC oprx8,SP
Decrement
Divide
A (H:A)(X); H Remainder
DIV
EOR
EOR
EOR
EOR
EOR
EOR
EOR
EOR
M (M) $01
A (A) $01
X (X) $01
M (M) $01
M (M) $01
M (M) $01
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
INC opr8a
INCA
INCX
INC oprx8,X
INC ,X
INC oprx8,SP
Increment
M (M) + $01
A (A) + $01
X (X) + $01
M (M) + $01
M (M) + $01
M (M) + $01
ii
dd
hh ll
ee ff
ff
ee ff
ff
dd rr
rr
rr
ff rr
rr
ff rr
Cycles
Source
Form
Address
Mode
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
pp
U 1 1
5
3
3
5
4
6
pprwp
pdp
pdp
pprwp
prwp
ppprwp
1 1
1 1
DIR
INH
INH
IX1
IX
SP1
3A dd
4A
5A
6A ff
7A
9E 6A ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
INH
52
pdpdddd
1 1
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A8
B8
C8
D8
E8
F8
9E D8
9E E8
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
DIR
INH
INH
IX1
IX
SP1
3C dd
4C
5C
6C ff
7C
9E 6C ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
BC
CC
DC
EC
FC
dd
hh ll
ee ff
ff
2
3
4
3
2
pp
ppp
ppdp
pdp
pp
1 1
BD
CD
DD
ED
FD
dd
hh ll
ee ff
ff
4
5
6
5
4
pssp
ppssp
ppssdp
pssdp
pssp
1 1
JMP
JMP
JMP
JMP
JMP
opr8a
opr16a
oprx16,X
oprx8,X
,X
Jump
PC Jump Address
DIR
EXT
IX2
IX1
IX
JSR
JSR
JSR
JSR
JSR
opr8a
opr16a
oprx16,X
oprx8,X
,X
Jump to Subroutine
PC (PC) + n (n = 1, 2, or 3)
Push (PCL); SP (SP) $0001
Push (PCH); SP (SP) $0001
PC Unconditional Address
DIR
EXT
IX2
IX1
IX
ii
dd
hh ll
ee ff
ff
ee ff
ff
1 1
53
Addressing Modes
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
LDHX #opr
LDHX opr
LDX
LDX
LDX
LDX
LDX
LDX
LDX
LDX
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
LSL opr8a
LSLA
LSLX
LSL oprx8,X
LSL ,X
LSL oprx8,SP
LSR opr8a
LSRA
LSRX
LSR oprx8,X
LSR ,X
LSR oprx8,SP
Operation
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
Object Code
Affect on CCR
Cyc-by-Cyc
Details
V11H INZC
Cycles
Source
Form
Address
Mode
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
ee ff
ff
2
3
4
4
3
2
5
4
45 ii jj
55 dd
3
4
ppp
prrp
0 1 1
ii
dd
hh ll
ee ff
ff
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
A6
B6
C6
D6
E6
F6
9E D6
9E E6
ii
dd
hh ll
ee ff
ff
IMM
DIR
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
AE
BE
CE
DE
EE
FE
9E DE
9E EE
DIR
INH
INH
IX1
IX
SP1
38 dd
48
58
68 ff
78
9E 68 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
DIR
INH
INH
IX1
IX
SP1
34 dd
44
54
64 ff
74
9E 64 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1 0
5
4
4
4
prpwp
prwp
ppwp
prwp
0 1 1
1 1 0 0
0
b7
b0
(Same as ASL)
Logical Shift Right
0
C
b7
b0
ee ff
ff
MOV opr8a,opr8a
MOV opr8a,X+
MOV #opr8i,opr8a
MOV ,X+,opr8a
Move
(M)destination (M)source
In IX+/DIR and DIR/IX+ Modes,
H:X (H:X) + $0001
DIR/DIR
DIR/IX+
IMM/DIR
IX+/DIR
4E
5E
6E
7E
MUL
Unsigned multiply
X:A (X) (A)
INH
42
ppddd
NEG opr8a
NEGA
NEGX
NEG oprx8,X
NEG ,X
NEG oprx8,SP
Negate
M (M) = $00 (M)
(Twos Complement) A (A) = $00 (A)
X (X) = $00 (X)
M (M) = $00 (M)
M (M) = $00 (M)
M (M) = $00 (M)
DIR
INH
INH
IX1
IX
SP1
30 dd
40
50
60 ff
70
9E 60 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
NOP
INH
9D
1 1
NSA
INH
62
ppd
1 1
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
AA
BA
CA
DA
EA
FA
9E DA
9E EA
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
0 1 1
ORA
ORA
ORA
ORA
ORA
ORA
ORA
ORA
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
dd dd
dd
ii dd
dd
ii
dd
hh ll
ee ff
ff
ee ff
ff
1 1
Freescale Semiconductor
Operation
Object Code
Affect on CCR
Cyc-by-Cyc
Details
V11H INZC
Cycles
Source
Form
Address
Mode
PSHA
INH
87
ps
1 1
PSHH
INH
8B
ps
1 1
PSHX
INH
89
ps
1 1
PULA
INH
86
pu
1 1
PULH
INH
8A
pu
1 1
PULX
INH
88
pu
1 1
DIR
INH
INH
IX1
IX
SP1
39 dd
49
59
69 ff
79
9E 69 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
DIR
INH
INH
IX1
IX
SP1
36 dd
46
56
66 ff
76
9E 66 ff
4
1
1
4
3
5
prwp
p
p
pprw
prw
ppprw
1 1
ROL opr8a
ROLA
ROLX
ROL oprx8,X
ROL ,X
ROL oprx8,SP
ROR opr8a
RORA
RORX
ROR oprx8,X
ROR ,X
ROR oprx8,SP
C
b7
b0
C
b7
b0
RSP
INH
9C
RTI
INH
80
puuuuup
RTS
INH
81
puup
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A2
B2
C2
D2
E2
F2
9E D2
9E E2
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
SBC
SBC
SBC
SBC
SBC
SBC
SBC
SBC
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
Pull (CCR)
Pull (A)
Pull (X)
Pull (PCH)
Pull (PCL)
ii
dd
hh ll
ee ff
ff
ee ff
ff
1 1
1 1
1 1
1 1
SEC
INH
99
1 1 1
SEI
INH
9B
pd
1 1 1
55
Addressing Modes
STA
STA
STA
STA
STA
STA
STA
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
Operation
DIR
EXT
IX2
IX1
IX
SP2
SP1
Object Code
B7
C7
D7
E7
F7
9E D7
9E E7
dd
hh ll
ee ff
ff
ee ff
ff
Affect on CCR
Cyc-by-Cyc
Details
V11H INZC
Cycles
Source
Form
Address
Mode
3
4
4
3
2
5
4
pwp
ppwp
pppw
ppw
pw
ppppw
pppw
0 1 1
STHX opr
DIR
35 dd
pwwp
0 1 1
STOP
INH
8E
1 1 0
DIR
EXT
IX2
IX1
IX
SP2
SP1
BF
CF
DF
EF
FF
9E DF
9E EF
dd
hh ll
ee ff
ff
3
4
4
3
2
5
4
pwp
ppwp
pppw
ppw
pw
ppppw
pppw
0 1 1
IMM
DIR
EXT
IX2
IX1
IX
SP2
SP1
A0
B0
C0
D0
E0
F0
9E D0
9E E0
ii
dd
hh ll
ee ff
ff
2
3
4
4
3
2
5
4
pp
prp
pprp
pppr
ppr
pr
ppppr
pppr
1 1
SWI
Software Interrupt
PC (PC) + $0001
Push (PCL); SP (SP) $0001
Push (PCH); SP (SP) $0001
Push (X); SP (SP) $0001
Push (A); SP (SP) $0001
Push (CCR); SP (SP) $0001
I 1;
PCH Interrupt Vector High Byte
PCL Interrupt Vector Low Byte
INH
83
psssssvvp
TAP
INH
84
pd
TAX
INH
97
1 1
TPA
INH
85
1 1
DIR
INH
INH
IX1
IX
SP1
3D dd
4D
5D
6D ff
7D
9E 6D ff
3
1
1
3
2
4
prp
p
p
ppr
pr
pppr
0 1 1
INH
95
pp
1 1
STX
STX
STX
STX
STX
STX
STX
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
SUB
SUB
SUB
SUB
SUB
SUB
SUB
SUB
#opr8i
opr8a
opr16a
oprx16,X
oprx8,X
,X
oprx16,SP
oprx8,SP
TST opr8a
TSTA
TSTX
TST oprx8,X
TST ,X
TST oprx8,SP
TSX
Subtract
A (A) (M)
(M) $00
(A) $00
(X) $00
(M) $00
(M) $00
(M) $00
ee ff
ff
ee ff
ff
1 1 1
1 1
Freescale Semiconductor
Opcode Map
Operation
Object Code
Affect on CCR
Cyc-by-Cyc
Details
V11H INZC
Cycles
Source
Form
Address
Mode
TXA
INH
9F
1 1
TXS
INH
94
pp
1 1
WAIT
INH
8F
1 1 0
Object Code:
dd
Direct address of operand
ee ff High and low bytes of offset in indexed, 16-bit offset
addressing
ff
Offset byte in indexed, 8-bit offset addressing
hh ll High and low bytes of operand address in extended
addressing
ii
Immediate operand byte
ii jj 16-bit immediate operand for H:X
rr
Relative program counter offset byte
Addressing Modes:
DIR
Direct addressing mode
EXT Extended addressing mode
IMM Immediate addressing mode
INH
Inherent addressing mode
IX
Indexed, no offset addressing mode
IX1
Indexed, 8-bit offset addressing mode
IX2
Indexed, 16-bit offset addressing mode
IX+
Indexed, no offset, post increment addressing mode
IX1+ Indexed, 8-bit offset, post increment addressing mode
REL Relative addressing mode
SP1 Stack pointer, 8-bit offset addressing mode
SP2 Stack pointer 16-bit offset addressing mode
Operation Symbols:
A
Accumulator
CCR Condition code register
H
Index register high byte
M
Memory location
n
Any bit
opr
Operand (one or two bytes)
PC
Program counter
PCH Program counter high byte
PCL Program counter low byte
rel
Relative program counter offset byte
SP
Stack pointer
SPH Most significant byte of stack pointer
SPL Least significant byte of stack pointer
X
Index register low byte
&
Logical AND
|
Logical OR
Logical EXCLUSIVE OR
()
Contents of
( )
Negation (twos complement)
#
Immediate value
Sign extend
Loaded with
?
If
:
Concatenated with
Cycle-by-Cycle Codes:
d
Dummy duplicate of the previous p, r, or s cycle.
d is always a read cycle so sd is a stack write
followed by a read of the address pointed to by the
updated stack pointer
p
Program fetch; read from next consecutive
location in program memory
r
Read 8-bit operand
s
Push (write) eight bits onto stack
u
Pop (read) eight bits from stack
v
Read vector from $FFxx (high byte first)
w
Write 8-bit operand
Not affected
U
Undefined
57
Branch
REL
DIR
INH
Read-Modify-Write
INH
IX1
Control
SP1
IX
INH
INH
IMM
DIR
EXT
9E6
Register/Memory
IX2
SP2
IX1
SP1
IX
9EE
HIGH
9ED
LOW
5
BRSET0
3
1
2
DIR 2
4
DIR
5
DIR 2
4
BSET1
2
DIR 2
4
BRCLR1 BCLR1
3
DIR
5
BRSET2
3
DIR
5
DIR 2
4
BSET2
2
DIR 2
4
BRCLR2 BCLR2
3
DIR
5
BRSET3
3
DIR
5
DIR 2
4
BSET3
2
DIR 2
4
BRCLR3 BCLR3
3
DIR
5
BRSET4
3
DIR
5
DIR 2
4
BSET4
2
DIR 2
4
BRCLR4 BCLR4
3
A
B
DIR
5
BRSET6
3
DIR
5
DIR 2
4
BSET5
2
DIR 2
4
BRCLR5 BCLR5
3
DIR
5
BRSET5
3
DIR
5
DIR 2
4
BSET6
2
DIR 2
4
BRCLR6 BCLR6
3
DIR
5
BRSET7
3
DIR
5
DIR 2
4
BSET7
2
DIR 2
4
Freescale Semiconductor
BRCLR7 BCLR7
3
INH
IMM
DIR
EXT
DD
IX+D
DIR
5
BRSET1
3
BSET0
2
BRCLR0 BCLR0
3
DIR
5
DIR
DIR 2
BRA
REL 2
3
BRN
REL 3
3
NEG
CBEQ
BCC
REL 2
3
BCS
REL 2
3
BNE
REL 2
3
BEQ
REL 2
3
BHCC
REL 2
3
BHCS
REL 2
3
BPL
REL 2
3
BMI
REL 3
3
BMC
REL 2
3
BMS
REL 2
3
1
4
COM
LSR
STHX
ROR
ASR
LSL
ROL
DIR 1
4
DBNZ
INC
TST
3
3
CLR
DIR 1
Inherent
REL
Relative
Immediate
IX
Indexed, No Offset
Direct
IX1
Indexed, 8-Bit Offset
Extended
IX2
Indexed, 16-Bit Offset
DIR/DIR
IMD
IMM/DIR
IX+/DIR
DIX+ DIR/IX+
*Pre-byte for stack pointer indexed instructions
INH 2
1
TSTX
INH 1
5
INH 2
4
MOV
DD 2
1
CLRA
DIX+ 3
1
CLRX
INH 1
IX1+
INH 3
1
INCX
INH 1
1
SP1
SP2
IX+
INH 2
3
DBNZX
INH 2
1
MOV
REL
3
REL 2
INH 1
3
TSTA
DIR 1
INH 2
1
DECX
INCA
DIR 1
3
INH 2
1
ROLX
INH 1
1
DBNZA
DIR 2
4
INH 2
1
LSLX
INH 1
1
DECA
DIR 1
5
INH 2
1
ASRX
INH 1
1
ROLA
DEC
DIR 3
1
RORX
INH 1
1
LSLA
DIR 1
4
BIL
BIH
IMM 2
1
ASRA
DIR 1
4
INH 2
4
LDHX
RORA
DIR 1
4
INH 2
1
LSRX
INH 1
3
LDHX
DIR 3
4
INH 1
1
COMX
INH 1
1
LSRA
DIR 1
4
IMM 3
7
DIV
INH 1
1
COMA
DIR 1
4
INH 2
4
CBEQX
IMM 3
5
MUL
REL
3
REL 2
3
NEGX
INH 1
4
CBEQA
DIR 3
BHI
BLS
NEGA
DIR 1
5
INH 2
NEG
CBEQ
NEG
IX1 3
5
CBEQ
IX1+ 4
3
1
5
COM
IX1 3
4
COM
LSR
LSR
SP1 1
CPHX
2
5
ROR
IX1 3
4
LSL
LSL
SP1 1
5
DBNZ
IX1 4
4
INC
DBNZ
INC
INC
TST
IX1 3
4
MOV
CLR
2
4
CLR
IX1 3
SP1 1
INH
1
WAIT
IX 1
ADD
IMM 2
JMP
BSR
INH 2
LDX
2
1
TXA
INH 1
INH 2
JSR
AIX
LDX
STX
IX2 4
4
SBC
IX2 4
4
CPX
IX2 4
4
AND
IX2 4
4
IX2 4
4
IX2 4
4
IX2 4
4
EOR
IX2 4
4
ADC
IX2 4
4
ORA
IX2 4
4
ADD
IX2 4
4
SUB
SUB
SP2 2
5
CMP
SBC
EXT 3
4
CPX
AND
IX2 4
IX1 3
3
AND
SP2 2
5
BIT
IX1 3
3
BIT
SP2 2
5
LDA
IX1 3
3
LDA
SP2 2
5
STA
IX1 3
3
STA
SP2 2
5
EOR
IX1 3
3
EOR
SP2 2
5
ADC
IX1 3
3
ADC
SP2 2
5
ORA
IX1 3
3
ORA
SP2 2
5
ADD
IX1 3
3
ADD
SP2 2
IX1 3
3
CMP
LDX
CMP
SBC
SP2 2
5
STX
SP2 2
IX1 3
3
STX
IX1 3
IX
2
SBC
SP1 1
4
CPX
IX
2
CPX
SP1 1
4
AND
IX
2
AND
SP1 1
4
BIT
IX
2
BIT
SP1 1
4
LDA
IX
2
LDA
SP1 1
4
STA
IX
2
STA
SP1 1
4
EOR
IX
2
EOR
SP1 1
4
ADC
IX
2
ADC
SP1 1
4
ORA
IX
2
ORA
SP1 1
4
ADD
IX
2
ADD
SP1 1
IX
2
JMP
1
IX
4
JSR
IX1
3
LDX
IX
2
SP1 1
4
JSR
2
2 HC08 Cycles
Opcode Mnemonic
IX Number of Bytes / Addressing Mode
SUB
1
SUB
SP1 1
4
IX1
5
SUB
JMP
2
IX2
4
STX
EXT 3
IX1 3
3
CPX
SP2 2
5
IX2
6
IX2 4
4
IX1 3
3
SBC
SP2 2
5
JMP
LDX
IX1 3
3
CMP
SP2 2
5
JSR
EXT 3
4
STX
DIR 3
EXT 3
5
LDX
DIR 3
3
IMM 2
EXT 3
3
JSR
DIR 3
3
IMM 2
2
EXT 3
4
JMP
DIR 3
4
REL 2
2
EXT 3
4
ADD
DIR 3
2
EXT 3
4
ORA
DIR 3
3
CLR
IMM 2
2
INH
1
NOP
STOP
DIR 3
3
CMP
STA
EXT 3
4
ADC
ORA
RSP
IX+D 1
2
IMM 2
2
IX2 4
4
LDA
EXT 3
4
EOR
DIR 3
3
ADC
ADD
INH 2
1
INH 1
IX
4
MOV
IMD
3
SEI
TST
SP1 1
EOR
ORA
INH 2
2
INH 1
1
CLRH
IX 1
2
INH 2
2
EXT 3
4
STA
DIR 3
3
IMM 2
2
ADC
CLI
INH 1
2
STA
SUB
BIT
LDA
DIR 3
3
IMM 2
2
EOR
INH 2
1
SEC
PSHH
IX 1
3
SP1 1
4
CLC
INH 1
2
LDA
AIS
INH 2
1
INH 1
2
PULH
IX 1
4
SP1 2
5
IX1 3
3
TST
IX 1
3
SP1 1
6
TAX
INH 1
2
EXT 3
4
BIT
DIR 3
3
IMM 2
2
EXT 3
4
AND
DIR 3
3
BIT
LDA
2
1
PSHX
DEC
AND
IMM 2
2
EXT 3
4
CPX
DIR 3
3
IMM 2
2
EXT 3
4
SBC
DIR 3
3
CPX
BIT
INH 2
INH
2
PULX
IX 1
3
ROL
DEC
IX1 3
5
DBNZ
LSL
ROL
TSX
PSHA
IX 1
3
SP1 1
5
IX1 3
4
DEC
ASR
SBC
IMM 2
2
EXT 3
4
CMP
DIR 3
3
IMM 2
2
AND
INH 2
2
PULA
IX 1
3
SP1 1
5
IX1 3
4
ROL
ROR
ASR
IX1 3
4
TXS
INH 1
2
CMP
CPX
REL 2
2
INH 1
1
TPA
DIR 1
3
SP1 1
5
BLE
INH 2
2
TAP
IX 1
4
CPHX
IMM
4
ASR
SWI
IX 1
3
SUB
DIR 3
3
IMM 2
2
SBC
REL 2
3
SUB
IMM 2
2
CMP
REL 2
3
BGT
2
9
SUB
REL 2
3
BLT
INH 2
INH
3
SP1 1
5
IX1 3
3
ROR
RTS
IX+ 1
2
BGE
INH 2
4
DAA
INH
4
LSR
RTI
IX 1
4
CBEQ
SP1 2
NSA
COM
NEG
SP1 1
6
IX
2
LDX
LDX
SP1 1
4
STX
SP1 1
IX
2
STX
IX
Addressing Modes
58
Chapter 5
Instruction Set
5.1 Introduction
This section contains detailed information for all HC08 Family instructions. The instructions are
arranged in alphabetical order with the instruction mnemonic set in larger type for easy reference.
5.2 Nomenclature
This nomenclature is used in the instruction descriptions throughout this section.
Operators
()
&
|
:
+
=
=
=
=
=
=
=
=
=
=
=
CPU registers
A
CCR
H
X
PC
PCH
PCL
SP
=
=
=
=
=
=
=
=
Accumulator
Condition code register
Index register, higher order (most significant) eight bits
Index register, lower order (least significant) eight bits
Program counter
Program counter, higher order (most significant) eight bits
Program counter, lower order (least significant) eight bits
Stack pointer
59
Instruction Set
M =
M:M + $0001 =
rel
=
=
=
=
=
=
0
1
U
=
=
=
=
=
Freescale Semiconductor
Nomenclature
=
=
=
=
=
=
=
=
=
Low-order eight bits of a direct address $0000$00FF (high byte assumed to be $00)
Upper eight bits of 16-bit offset
Lower eight bits of 16-bit offset or 8-bit offset
One byte of immediate data
High-order byte of a 16-bit immediate data value
Low-order byte of a 16-bit immediate data value
High-order byte of 16-bit extended address
Low-order byte of 16-bit extended address
Relative offset
Source forms
The instruction detail pages provide only essential information about assembler source forms.
Assemblers generally support a number of assembler directives, allow definition of program
labels, and have special conventions for comments. For complete information about writing
source files for a particular assembler, refer to the documentation provided by the assembler
vendor.
Typically, assemblers are flexible about the use of spaces and tabs. Often, any number of spaces
or tabs can be used where a single space is shown on the glossary pages. Spaces and tabs are
also normally allowed before and after commas. When program labels are used, there must also
be at least one tab or space before all instruction mnemonics. This required space is not apparent
in the source forms.
Everything in the source forms columns, except expressions in italic characters, is literal
information which must appear in the assembly source file exactly as shown. The initial 3- to
5-letter mnemonic is always a literal expression. All commas, pound signs (#), parentheses, and
plus signs (+) are literal characters.
The definition of a legal label or expression varies from assembler to assembler. Assemblers also
vary in the way CPU registers are specified. Refer to assembler documentation for detailed
information. Recommended register designators are a, A, h, H, x, X, sp, and SP.
n Any label or expression that evaluates to a single integer in the range 07
opr8i Any label or expression that evaluates to an 8-bit immediate value
opr16i Any label or expression that evaluates to a 16-bit immediate value
opr8a Any label or expression that evaluates to an 8-bit value. The instruction treats this
8-bit value as the low order eight bits of an address in the direct page of the 64-Kbyte
address space ($00xx).
opr16a Any label or expression that evaluates to a 16-bit value. The instruction treats this
value as an address in the 64-Kbyte address space.
oprx8 Any label or expression that evaluates to an unsigned 8-bit value; used for indexed
addressing
oprx16 Any label or expression that evaluates to a 16-bit value. Since the MC68HC08S has a
16-bit address bus, this can be either a signed or an unsigned value.
61
Instruction Set
rel
Any label or expression that refers to an address that is within 128 to +127 locations
from the next address after the last byte of object code for the current instruction. The
assembler will calculate the 8-bit signed offset and include it in the object code for this
instruction.
Address modes
INH
IMM
DIR
EXT
IX
IX+
IX1
IX1+
IX2
REL
SP1
SP2
=
=
=
=
=
=
=
=
=
=
=
=
Freescale Semiconductor
Memory
$0000
$003F
I/O REGISTERS
64 BYTES
$0040
$007F
RESERVED(1)
64 BYTES
$0080
$00FF
RAM
128 BYTES
$0100
$27FF
UNIMPLEMENTED(1)
9984 BYTES
$2800
$2DFF
AUXILIARY ROM
1536 BYTES
$2E00
$EDFF
UNIMPLEMENTED(1)
49152 BYTES
$EE00
$FDFF
FLASH MEMORY
MC68HC908QT4 AND MC68HC908QY4
4096 BYTES
Note 1.
Attempts to execute code from addresses in this
range will generate an illegal address reset.
$2E00
UNIMPLEMENTED
51712 BYTES
$F7FF
$FE00
$FE01
$FE02
$FE03
$FE04
$FE05
$FE06
$FE07
$FE08
$FE09
$FE0A
$FE0B
$FE0C
LVISR
$FE0D
$FE0F
$FE10
$FFAF
$FFB0
$FFBD
FLASH
14 BYTES
$FFBE
$FFBF
RESERVED FLASH
$FFC0
$FFC1
RESERVED FLASH
$FFC2
$FFCF
FLASH
14 BYTES
$FFD0
$FFFF
USER VECTORS
48 BYTES
FLASH MEMORY
1536 BYTES
$F800
$FDFF
MC68HC908QT1, MC68HC908QT2,
MC68HC908QY1, and MC68HC908QY2
Memory Map
Freescale Semiconductor