®
TM
ARM Cortex -M1
Programmer’s Model
r0
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r11
The ARM Cortex-M1 processor supports all ARMv6-M
Thumb instructions. This includes the entire 16-bit
Thumb instruction set architecture and some 32-bit
instructions. or information on ARMv6-M Thumb
instructions, see the ARMv6-M Architecture Reference
Manual. The processor does not support ARM
instructions.
Low Registers
High Registers
Processor Operating States
The ARM Cortex-M1 processor has two operating states:
r12
r13 (SP)
r14 (LR)
r15 (PC)
xPSR
SP_process
SP_main
•
Thumb state – This is the normal execution state,
with the processor running the 16-bit and 32-bit
halfword-aligned Thumb and Thumb-2 BL, MRS,
MSR, ISB, DSB, and DMB instructions.
Program
Status Register
Figure 2 • Processor Register Set
•
Debug state – This is the state the processor is in
for debugging.
General Purpose Registers
The general purpose registers, R0–R12, have no special
architecturally-defined uses.
Processor Operating Modes
The ARM Cortex-M1 processor supports two modes of
operation:
•
Low registers – Registers R0–R7 are accessible by
all instructions that specify a general purpose
register.
•
Thread mode – Entered on Reset, and can be re-
•
High registers
– Registers R8-R12 are not
entered as a result of an exception return.
accessible by all 16-bit instructions.
•
Handler mode – Entered as a result of an
The R13, R14, and R15 registers have the following
special functions:
exception.
•
•
•
Stack Pointer – Register R13 is used as the Stack
Pointer (SP). Because the SP ignores writes to bits
[1:0], it is auto-aligned to a word, four-byte, and
boundary. Handler mode always uses SP_main, but
you can configure Thread mode to use either
SP_main or SP_process.
Main Stack and Process Stack Access
Out of reset, all code uses the main stack. An exception
handler such as SVC can change the stack used by Thread
mode from main stack to process stack by changing the
EXC_RETURN value it uses on exit. All exceptions
continue to use the main stack. The stack pointer, R13, is
a banked register that switches between the main stack
and the process stack. Only one stack, either the process
stack or the main stack, is visible, using R13, at any time.
Link Register – Register R14 is the subroutine
Link Register (LR). The LR receives the return
address from PC when a Branch and Link (BL)
instruction is executed. The LR is also used for an
exception return. At all other times, you can treat
R14 as a general purpose register.
It is also possible to switch from the main stack to process
stack while in Thread mode by writing to the special
purpose Control Register using an MSR instruction.
Program Counter – Register R15 is the Program
Counter (PC). Bit 0 is always 0, so instructions are
always aligned to halfword boundaries.
Registers
The processor has the following 32-bit registers
(Figure 2):
Special Purpose Program Status Registers
(xPSR)
Processor status at the system level breaks down into
three categories and can be accessed as individual
registers, a combination of any two from three, or a
combination of all three, using the MRS and MSR
instructions.
•
•
13 general purpose registers, R0–R12
Stack Pointer (SP) (SP, R13) and banked register
aliases, SP_process and SP_main
•
•
•
Link Register (LR, R14)
Program Counter (PC, R15)
Program status registers (xPSR)
•
Application PSR (APSR) – Contains the condition
code flags. Before entering an exception, the
processor saves the condition code flags on the
Product Brief
5