Programming Model
84
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Cortex
®
-M4F Processor
1.4.2 Stacks
The processor uses a full descending stack, meaning that the stack pointer indicates the last stacked item
on the memory. When the processor pushes a new item onto the stack, it decrements the stack pointer
and then writes the item to the new memory location. The processor implements two stacks: the main
stack and the process stack, with a pointer for each held in independent registers (see the SP register on
In thread mode, the CONTROL register (see
) controls whether the processor uses the main
stack or the process stack. In handler mode, the processor always uses the main stack.
lists the
options for processor operations.
(1)
See CONTROL (
).
Table 1-1. Summary of Processor Mode, Privilege Level, and Stack Use
Processor Mode
Use
Privilege Level
Stack Used
Thread
Applications
Privileged or unprivileged
(1)
Main stack or process stack
(1)
Handler
Exception handlers
Always privileged
Main stack