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 RegisterdϾ਼͟ᛌܸᅺSPЪމܸΣ̴ה᙮਼ᛌᅲπኜSRٙЗѧf
νϤί༪Ցਓόʘۃd̀ਗ਼͉ԒٙʈЪᐑྤʿண֛存入(Push)਼ᛌᅲπ
ኜSRʫfਓόੂБҁଭܝdΎਗ਼਼ᛌᅲπኜSRٙʫ࢙取回(Pop)d
ԴՉঐܨూࡡϞٙʈЪᐑྤʿண֛fΝࣛί CONTROL[1] ̙ண֛፯͜主堆疊
指標暫存器MSP: Main Stack Pointerא處理器堆疊指標暫存器PSP: Process
Stack Pointerf
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