The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors
4.2.3 Program status registers
The Program Status Register is composed of three status registers:
-
Application PSR (APSR)
-
Execution PSR (EPSR)
-
Interrupt PSR (IPSR)
These three registers (Figure 4.5) can be accessed as one combined register,
referred to as xPSR in some documentation. In ARM assembler, when accessing xPSR (Figure 4.6), the symbol PSR is used. For example:MRS r0, PSR ; Read the combined program status word MSR PSR, r0 ; Write combined program state word
You can also access an individual PSR (Figure 4.5). For example:MRS r0, APSR ; Read Flag state into R0 MRS r0, IPSR ; Read Exception/Interrupt state MSR APSR, r0 ; Write Flag state
Please note:
- The ERSR cannot be accessed by software code directly using MRS (read as zero) or MSR
- The IPSR is read only and can be read from combined PSR (xPSR).