420 likes | 525 Vues
This document serves as a comprehensive reference for the CPU12 microprocessor including detailed exploration of its registers, addressing modes, and instructions. It covers essential concepts such as the Condition Code Register, Accumulators, Index Registers (X and Y), and the Stack Pointer. Instructions for loading the Accumulator (LDAA) and examples of various addressing modes are provided to facilitate a practical understanding of the CPU12 functionality. This reference will assist in answering all questions related to HCS12 instructions and addressing modes.
E N D
The CPU12 Microprocessor Core Lecture L2.1
Reference 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
Introducing the CPU12 • The CPU12 Registers • CPU12 Addressing Modes • CPU12 Instructions
A 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 A c c u m u l a t o r D D The 68HC12 Accumulators
I 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
S t a c k P o i n t e r S P Stack Pointer, SP
Introducing the CPU12 • The CPU12 Registers • CPU12 Addressing Modes • CPU12 Instructions
Using X as a stack pointerfor a data stack LDY 2,X+will pop $1234 into Y
Introducing the CPU12 • The CPU12 Registers • CPU12 Addressing Modes • CPU12 Instructions
Load 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]
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 2’s comp = 100111000 = $138 11101001 = $E9
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
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
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