2.5.1.2 Stacks

The processor uses a full descending stack. This means the stack pointer holds the address of the last stacked item in the stack 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, held in independent registers, see Stack Pointer.

In Thread mode, the CONTROL register controls whether the processor uses the main stack or the process stack, see CONTROL Register. In Handler mode, the processor always uses the main stack. The options for processor operations are:

Table 2-1. Summary of Processor Mode, Execution Privilege Level, and Stack Use Options
Processor ModeUsed to ExecutePrivilege Level for Software ExecutionStack Used
ThreadApplicationsPrivileged or unprivilegedMain stack or process stack
HandlerException handlersAlways privilegedMain stack