Programmer’s Model
ARM DDI 0301H
Copyright © 2004-2009 ARM Limited. All rights reserved.
2-28
ID012310
Non-Confidential, Unrestricted Access
Mode bits
M[4:0] are the mode bits. Table 2-7 lists how these bits determine the processor operating mode.
2.10.8
Modification of PSR bits by MSR instructions
In previous architecture versions, MSR instructions can modify the flags byte, bits [31:24], of
the CPSR in any mode, but the other three bytes are only modifiable in privileged modes.
After the introduction of ARM architecture v6, however, each CPSR bit falls into one of the
following categories:
•
Bits that are freely modifiable from any mode, either directly by MSR instructions or by
other instructions whose side-effects include writing the specific bit or writing the entire
CPSR.
Bits in Figure 2-10 on page 2-24 that are in this category are N, Z, C, V, Q, GE[3:0], and E.
•
Bits that must never be modified by an MSR instruction, and so must only be written as a
side-effect of another instruction. If an MSR instruction does try to modify these bits the
results are architecturally Unpredictable. In the processor these bits are not affected.
Bits in Figure 2-10 on page 2-24 that are in this category are J and T.
•
Bits that can only be modified from privileged modes, and that are completely protected
from modification by instructions while the processor is in User mode. The only way that
these bits can be modified while the processor is in User mode is by entering a processor
exception, as
Exceptions
on page 2-36 describes.
Bits in Figure 2-10 on page 2-24 that are in this category are A, I, F, and M[4:0].
Table 2-7 PSR mode bit values
M[4:0]
Mode
Visible state registers
Thumb ARM
b10000
User
R0–R7, R8-R12
a
, SP, LR, PC, CPSR
R0–R14, PC, CPSR
b10001
FIQ
R0–R7, R8_fiq-R12_fiq
a
, SP_fiq, LR_fiq PC,
CPSR, SPSR_fiq
R0–R7, R8_fiq–R14_fiq, PC, CPSR,
SPSR_fiq
b10010
IRQ
R0–R7, R8-R12
a
, SP_irq, LR_irq, PC, CPSR,
SPSR_irq
R0–R12, R13_irq, R14_irq, PC, CPSR,
SPSR_irq
b10011
Supervisor
R0–R7, R8-R12
a
, SP_svc, LR_svc, PC, CPSR,
SPSR_svc
R0–R12, R13_svc, R14_svc, PC, CPSR,
SPSR_svc
b10111
Abort
R0–R7, R8-R12
a
, SP_abt, LR_abt,
PC, CPSR, SPSR_abt
R0–R12, R13_abt, R14_abt, PC, CPSR,
SPSR_abt
b11011
Undefined
R0–R7, R8-R12
a
, SP_und,
LR_und, PC, CPSR, SPSR_und
R0–R12, R13_und, R14_und,
PC, CPSR, SPSR_und
b11111
System
R0–R7, R8-R12
a
, SP, LR, PC, CPSR
R0–R14, PC, CPSR
b10110
Secure
Monitor
R0-R7, R8-R12
a
, SP_mon, LR_mon, PC, CPSR,
SPSR_mon
R0-R12, PC,CPSR, SPSR_mon,
R13_mon,R14_mon
a. Access to these registers is limited in Thumb state.