Professional Documents
Culture Documents
Example val_ok:
val_err:
B val_err // jump to itself (loop forever)
BL
Branch with Link. Use to call subroutines.
Description Copy address of next instruction to R14 and jump to label. The jump
distance must be within 4Mb of the current instruction. Note that this
mnemonic is generated as two 16-bit Thumb instructions.
BLX
Performs a branch with link.
Syntax BLX{cond} Rm
BLX label
Description BLX{cond} Rm
Copy address of next instruction to R14 and jump to address in Rm.
BLX label
Copy address of next instruction to R14, change to ARM instruction set and
jump to label. The jump distance must be within 4MByte of the current
instruction. Note that this mnemonic is generated as two 16-bit Thumb
instructions.
LDR R6,=function
BLX R6 // call function
BX
Branch indirect and switch CPU mode (Thumb / ARM) as required.
Syntax BX{cond} Rm
Condition Code
Most ARM instructions and the Thumb Branch instruction include a condition code field.
This field is marked in the CPU instructions with {cond}.A conditional instruction is only
executed on match of the condition flags in the Program Status Register. For example, the
BEQ (B instruction with EQ condition) branches only if the Z flag is set. If the {cond} field is
empty the instruction is always executed.