You copied the Doc URL to your clipboard.

BLX

Branch with Link and exchange instruction set.

Syntax

BLX{cond}{.W} label

BLX{cond} Rm

where:

cond

is an optional condition code. cond is not available on all forms of this instruction.

.W

is an optional instruction width specifier to force the use of a 32-bit BLX instruction in T32.

label

is a PC-relative expression.

Rm

is a register containing an address to branch to.

Operation

The BLX instruction causes a branch to label, or to the address contained in Rm. In addition:

  • The BLX instruction copies the address of the next instruction into LR (R14, the link register).
  • The BLX instruction can change the instruction set.

    BLX label always changes the instruction set. It changes a processor in A32 state to T32 state, or a processor in T32 state to A32 state.

    BLX Rm derives the target instruction set from bit[0] of Rm:

    • If bit[0] of Rm is 0, the processor changes to, or remains in, A32 state.
    • If bit[0] of Rm is 1, the processor changes to, or remains in, T32 state.

Note

There are no equivalent instructions to BLX to change between AArch32 and AArch64 state. The only way to change execution state is by a change of exception level.

Instruction availability and branch ranges

The following table shows the BLX instructions that are available in A32 and T32 state. Instructions that are not shown in this table are not available.

Table 13-6 BLX instruction availability and range

Instruction A32 T32, 16-bit encoding T32, 32-bit encoding
BLX label ±32MB ±4MB a ±16MB
BLX Rm Available Available Use 16-bit
BLX{cond} Rm Available - -

Register restrictions

You can use PC for Rm in the A32 BLX instruction, but this is deprecated. You cannot use PC in other A32 instructions.

You can use PC for Rm in the T32 BLX instruction. You cannot use PC in other T32 instructions.

You can use SP for Rm in this A32 instruction but this is deprecated.

You can use SP for Rm in the T32 BLX instruction, but this is deprecated. You cannot use SP in the other T32 instructions.

Condition flags

This instruction does not change the flags.

Availability

See the preceding table for details of availability of the BLX instruction in both instruction sets.

Related reference

a 

BLX label and BL label are an instruction pair.

Was this page helpful? Yes No