Title: The CPU12 Microprocessor Core
1The CPU12 Microprocessor Core
2Reference
S12CPUV2 Reference Manual S12CPUV2.pdf (in .zip
file)
Print out Appendix A Instruction Reference It
will answer all questions concerning
HCS12 instructions and addressing modes
3Introducing the CPU12
- The CPU12 Registers
- CPU12 Addressing Modes
- CPU12 Instructions
4The 68HC12 Registers
5Condition Code Register
6A
c
c
u
m
u
l
a
t
o
r
A
A
c
c
u
m
u
l
a
t
o
r
B
A
B
D
A
c
c
u
m
u
l
a
t
o
r
D
The 68HC12 Accumulators
7(No Transcript)
8(No Transcript)
9(No Transcript)
10(No Transcript)
11I
n
d
e
x
r
e
g
i
s
t
e
r
X
X
I
n
d
e
x
r
e
g
i
s
t
e
r
Y
Y
Index Registers, X and Y
12(No Transcript)
13S
t
a
c
k
P
o
i
n
t
e
r
S
P
Stack Pointer, SP
14(No Transcript)
15Introducing the CPU12
- The CPU12 Registers
- CPU12 Addressing Modes
- CPU12 Instructions
16(No Transcript)
17(No Transcript)
18Pre-decrement indexed addressing
19Using X as a stack pointerfor a data stack
LDY 2,X will pop 1234 into Y
20MOVW 0,X,2,-X
21LDD 0,XMOVW 2,X,0,XSTD 2,X
22MOVW 2,X,2,-X
23Introducing the CPU12
- The CPU12 Registers
- CPU12 Addressing Modes
- CPU12 Instructions
24(No Transcript)
25(No Transcript)
26(No Transcript)
27(No Transcript)
28(No Transcript)
29(No Transcript)
30(No Transcript)
31(No Transcript)
32(No Transcript)
33(No Transcript)
34(No Transcript)
35(No Transcript)
36(No Transcript)
37Load Accumulator A
1 LDAA
Addressing Modes 2 00004000
ORG 4000 3 4000 86 35
LDAA 35 4 4002
96 A3 LDAA A3 5
4004 B6 5678 LDAA
5678 6 4007 A6 03
LDAA 3,X 7 4009 A6 E9 38
LDAA -200,Y 8 400C A6 F2
1234 LDAA 1234,SP 9
4010 A6 E7 LDAA
D,X 10 4012 A6 EB 2345
LDAA 2345,Y
38 1 LDAA
Addressing Modes 2 00004000
ORG 4000 3 4000 86 35
LDAA 35 4 4002
96 A3 LDAA A3 5
4004 B6 5678 LDAA
5678 6 4007 A6 03
LDAA 3,X 7 4009 A6 E9 38
LDAA -200,Y 8 400C A6 F2
1234 LDAA 1234,SP 9
4010 A6 E7 LDAA
D,X 10 4012 A6 EB 2345
LDAA 2345,Y
200 C8 11001000 9-bit 011001000 2s
comp 100111000 138
11101001 E9
39 1 LDAA
Addressing Modes 2 00004000
ORG 4000 3 4000 86 35
LDAA 35 4 4002
96 A3 LDAA A3 5
4004 B6 5678 LDAA
5678 6 4007 A6 03
LDAA 3,X 7 4009 A6 E9 38
LDAA -200,Y 8 400C A6 F2
1234 LDAA 1234,SP 9
4010 A6 E7 LDAA
D,X 10 4012 A6 EB 2345
LDAA 2345,Y
11110010 F2
40 1 LDAA
Addressing Modes 2 00004000
ORG 4000 3 4000 86 35
LDAA 35 4 4002
96 A3 LDAA A3 5
4004 B6 5678 LDAA
5678 6 4007 A6 03
LDAA 3,X 7 4009 A6 E9 38
LDAA -200,Y 8 400C A6 F2
1234 LDAA 1234,SP 9
4010 A6 E7 LDAA
D,X 10 4012 A6 EB 2345
LDAA 2345,Y
11100111 E7
41 1 LDAA
Addressing Modes 2 00004000
ORG 4000 3 4000 86 35
LDAA 35 4 4002
96 A3 LDAA A3 5
4004 B6 5678 LDAA
5678 6 4007 A6 03
LDAA 3,X 7 4009 A6 E9 38
LDAA -200,Y 8 400C A6 F2
1234 LDAA 1234,SP 9
4010 A6 E7 LDAA
D,X 10 4012 A6 EB 2345
LDAA 2345,Y
11101011 EB
42(No Transcript)