C.3 Use of Stack Pointer - as a general purpose register R13

R13 is defined in the Thumb instruction set so that its use is primarily as a stack pointer. R13 is normally identified as Stack Pointer (SP) in Thumb instructions.

In 32-bit Thumb instructions, if you use SP as a general purpose register beyond the architecturally defined constraints, the results are unpredictable.

In the Cortex®‑M33 processor, the use of R13 as a named register specifier for any source or destination register that is indicated as unpredictable generates an UNDEFINSTR UsageFault exception.

In the architecture where the use of R13 as a general purpose register is defined, bits[1:0] of the register must be treated as SBZP. Writing a non-zero value to bits [1:0] results in unpredictable behavior. In the Cortex‑M33 processor bits [1:0] of R13 are always RAZ/WI.

Non-ConfidentialPDF file icon PDF version100230_0004_00_en
Copyright © 2016–2018 Arm Limited or its affiliates. All rights reserved.