Skip to main content

IAR Embedded Workbench for RX 5.20

The user mode and supervisor mode stacks

In this section:

There are two stacks, the user mode stack and the supervisor mode stack. They are two continuous blocks of memory pointed to by the stack pointer registers USP and ISP.

The data block used for holding the user mode stack is called USTACK and the data block for the supervisor mode stack is called ISTACK. The system startup code initializes the stack pointers to the end of the stack blocks.

The processor will be in supervisor mode on power on reset and when processing an interrupt. To enter user mode, special instruction sequences must be executed, as described in the chip manufacturer’s documentation.

The startup sequence in cstartup.s will remain in supervisor mode when calling the main function, so only the ISTACK block will be used until the application enters user mode by its own means.