b.w
Branch (Wide)
B.W <label>
Thumb-2 32-bit Unconditional Branch (large range).
Details
Thumb-2 32-bit unconditional branch with large range (±16 MB). Computes the target address by sign-extending the immediate offset (formed from S, imm10, J1, J2, imm11) and adding it to PC. No condition flags are affected; no registers are modified except PC.
Pseudocode Operation
if ConditionPassed() then
offset ← SignExtend(S || imm10 || J1 || J2 || imm11, 24)
PC ← PC + (offset << 1)
Example
B.W label
Encoding
Binary Layout
11110
S
imm10
10
J1
1
J2
imm11
Operands
-
label
Label
Reference (Arm AArch32 ISA)
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0A000000 | B{<c>}{<q>} <label> | A32 | cond | 101 | 0 | imm24 | ||
| 0xD000 | B<c>{<q>} <label> | T32 | 1101 | cond | imm8 | ||
| 0xE000 | B{<c>}{<q>} <label> | T32 | 11100 | imm11 | ||
| 0xF0008000 | B<c>.W <label> | T32 | 11110 | S | cond | imm6 | 10 | J1 | 0 | J2 | imm11 | ||
| 0xF0009000 | B{<c>}.W <label> | T32 | 11110 | S | imm10 | 10 | J1 | 1 | J2 | imm11 |
Description
Branch causes a branch to a target address.
Operation
if ConditionPassed() then
EncodingSpecificOperations();
BranchWritePC(PC + imm32, BranchType_DIR);