
User’s Manual
C166S V1 SubSystem
Table of Contents Page
User’s Manual I-2 V 1.6, 2001-08
3.4.5.2 Hardware Traps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
3.4.6 Peripheral Event Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32
3.4.6.1 The PEC Source and Destination Pointers . . . . . . . . . . . . . . . . . . 3-33
3.4.6.2 PEC Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-36
3.4.6.3 Short Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38
3.4.6.4 Long Transfer Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-39
3.4.6.5 Channel Link Mode for Data Chaining . . . . . . . . . . . . . . . . . . . . . . 3-41
3.4.6.6 PEC Channels Assignment and Arbitration . . . . . . . . . . . . . . . . . . 3-43
3.4.6.7 Programmable End of PEC Interrupt Level . . . . . . . . . . . . . . . . . . 3-44
3.5 Using General-Purpose Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-46
3.5.1 Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50
3.6 Data Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
3.6.1 Short Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52
3.6.2 Long and Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . 3-54
3.6.2.1 Addressing via Data Page Pointer . . . . . . . . . . . . . . . . . . . . . . . . . 3-55
3.6.2.2 DPP Override Mechanism in the C166S . . . . . . . . . . . . . . . . . . . . 3-57
3.6.2.3 Long Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58
3.6.2.4 Indirect Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-59
3.6.3 The System Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-61
3.6.3.1 Stack Overflow and Underflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-62
3.6.3.2 Linear Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64
3.6.3.3 Circular (Virtual) Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-65
3.7 Data Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68
3.7.1 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68
3.7.2 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70
3.7.3 The 16-bit Adder/Subtracter, Barrel Shifter
and the 16-bit Logic Unit 3-70
3.7.4 Bit-manipulation Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-70
3.7.5 Multiply and Divide Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-72
3.7.6 The Processor Status Word Register (PSW) . . . . . . . . . . . . . . . . . . 3-76
3.8 Instruction Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-80
3.8.1 Particular Pipeline Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-80
3.8.1.1 General considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-81
3.8.1.2 Specific cases with core registers . . . . . . . . . . . . . . . . . . . . . . . . . 3-81
3.8.1.3 Common portable solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-86
3.8.2 Instruction State Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-87
3.9 Dedicated CSFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-89
3.10 Summary of CPU Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-91
3.10.1 General Purpose Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-91
3.10.2 Core Special Function Registers Ordered by Name . . . . . . . . . . . . . 3-93
3.10.3 Core Special Function Registers ordered by Address . . . . . . . . . . . 3-94
3.10.4 Register Overview C166S Interrupt and Peripheral Event Controller 3-95