4.2.1. The branch and exchange instruction

The BX instruction is available only on cores that support Thumb. The instruction branches to the address contained in a specified register, and has a 4GB address range. The value of bit 0 of the branch address determines whether execution continues in ARM state or Thumb state. See Interworking with ARM architecture v5T and later for additional instructions available with ARMv5.

Bit 0 of an address can be used in this way because:

Syntax

The syntax of BX is one of:

Thumb
BX Rn
ARM
BX{cond} Rn

where:

Rn

Is a register in the range r0 to r15 that contains the address to branch to. The value of bit 0 in this register determines the processor state:

  • if bit 0 is set, the instructions at the branch address are executed in Thumb state

  • if bit 0 is clear, the instructions at the branch address are executed in ARM state.

cond

Is an optional condition code. Only the ARM version of BX can be executed conditionally.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0203G
Non-Confidential