The STM32 Cortex-M0 instruction set PM0215
60/91 Doc ID 022979 Rev 1
Restrictions
The restrictions are:
● Do not use SP or PC in the BX or BLX instruction
● For BX and BLX, bit[0] of Rm must be 1 for correct execution. Bit[0] is used to update
the EPSR T-bit and is discarded from the target address.
Bcond is the only conditional instruction on the Cortex-M0 processor.
Condition flags
These instructions do not change the flags.
Examples
B loopA ; Branch to loopA
BL funC ; Branch with link (Call) to function funC, return address
; stored in LR
BX LR ; Return from function call
BLX R0 ; Branch with link and exchange (Call) to a address stored
; in R0
BEQ labelD ; Conditionally branch to labelD if last flag setting
; instruction set the Z flag, else do not branch.
BL label −16 MB to +16 MB
BX Rm Any value in register
BLX Rm Any value in register
Table 22. Branch ranges (continued)
Instruction Branch range