ARM CPU 為用戶模式提供了 16 個通用寄存器和一個狀態(tài)寄存器 (CPSR), 不同模式間還提供有備份狀態(tài)寄存器(SPSR). 對于軟硬件的一些約定, 下面三個寄存器有著不同的含義, 使用時要注意:
R13 is used as stack pointer (SP) that holds the current stack address(堆棧指針)
R14 is used as link register (LR) that saves return address for the BL and BLX instruction(鏈接寄存器)
R15 is used as program counter (PC) that points to the executed instruction(程序計數(shù)器)
當不同的 CPU 操作模式之間進行切換時, ARM 提供了影子寄存器. 這些影子寄存器可以縮短中斷延遲時間(Interrupt Latency), 以提高性能. 這些寄存器的分布如下圖所示: