Page 16 - ARMMbedOS物聯網實戰應用超入門
P. 16

第一章 Cortex-M 系列與 STM32 晶片介紹


                  1   通用暫存器(General Purpose Rigisters)
                       Չʕ R0 ~ R7 މЭ€Lowᅲπኜʿ R8 ~ R12 މ৷€Highᅲπኜf


                  2   堆疊指標(SP: Stack Point)R13

                       CPU ක֐ੂБ઼֐೻όࣛdึ஝ྌɓ෯ RAM ٤ගЪމ਼ᛌᅲπኜ€SR:

                 Stack RegisterdϾ਼͟ᛌܸᅺ€SPЪމܸΣ̴ה᙮਼ᛌᅲπኜ€SRٙЗѧf
                 νϤί༪Ցਓ೻όʘۃd̀඲ਗ਼͉ԒٙʈЪᐑྤʿண֛存入(Push)਼ᛌᅲπ

                 ኜ€SRʫfਓ೻όੂБҁଭܝdΎਗ਼਼ᛌᅲπኜ€SRٙʫ࢙取回(Pop)d

                 ԴՉঐ੄ܨూࡡϞٙʈЪᐑྤʿண֛fΝࣛί CONTROL[1] ̙ண֛፯͜主堆疊
                 指標暫存器€MSP: Main Stack Pointerא處理器堆疊指標暫存器€PSP: Process

                 Stack Pointerf


                  3   連結暫存器(LR: Link Register)R14

                       ͜׵˴೻όʿਓ೻όʘගٙ༶Ъd຅˴೻όࠅ༪Ցਓ೻όʘۃdึ΋ਗ਼˴೻
                 όٙɨɓࡈЗѧ€ARM ࣛ PC+4 א Thumb ࣛ PC+2πɝஹഐᅲπኜ€LRʫd

                 ʑ༪Ցਓ೻όੂБfੂБҁଭܝdΎ՟Ϋஹഐᅲπኜ€LRٙЗѧ׳ɝ೻όࠇ

                 ᅰኜ€PCʫd˿̴ΫՑ˴೻όٙɨɓࡈЗѧᘱᚃੂБf


                  4   程式計數器(PC: Program Counter)R15
                       ͦۃ೻όੂБٙЗѧd̴݊ 32-bit ٙࠇᅰኜfί ARM ᅼόࣛੂБ 32-bit ܸ

                 ˿ึԴ PC+4fί Thumb ᅼόࣛੂБ 16-bit ܸ˿ึԴ PC+2f


                  5   程式狀態暫存器(PSR: Program Status Registers)

                       Ϟ 3 ࡈdνྡ 1-3 הͪj


                           31 30 29 28 27  25 24 23                                 6  5          0
                      APSR  N Z C V                             Reserved


                       IPSR                          Reserved                         Exception Number


                      EPSR      Reserved   T                         Reserved


                                             圖  1-3  程式狀態暫存器(PSR)




                                                                                                            1-9
   11   12   13   14   15   16   17   18   19   20   21