bx
Branch and Exchange
BX<c> <Rm>
Branches to address in register, optionally switching ISA.
Pseudocode Operation
if ConditionPassed() then
new_PC ← Rm & 0xFFFFFFFE
if (Rm & 1) == 1 then
CPSR.T ← 1
else
CPSR.T ← 0
BranchWritePC(new_PC)
Example
BX r2
Encoding
Binary Layout
cond
31:28
00010010
27:20
1
19
1
18
1
17
1
16
1
15
1
14
1
13
1
12
1
11
1
10
1
9
1
8
0001
7:4
Rm
3:0
Operands
-
Rm
Target Reg
Related
More in A32 (Base)
Reference
View in Arm A64 ISA Reference ↗
Arm AArch32 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x012FFF10 | BX{<c>}{<q>} <Rm> | A32 | cond | 00010010 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0001 | Rm | ||
| 0x4700 | BX{<c>}{<q>} <Rm> | T32 | 01000111 | 0 | Rm | 0 | 0 | 0 |
Description
Branch and Exchange causes a branch to an address and instruction set specified by a register.
Operation
if ConditionPassed() then
EncodingSpecificOperations();
BXWritePC(R[m], BranchType_INDIR);