b
Branch (A32)
B<c> <label>
Branch relative (PC +/- 32MB).
Details
Performs a relative branch to a label up to ±32 MB from the current instruction. The branch is taken only if the condition code (specified by <c>) is satisfied; if no condition is specified, it is always taken (AL). The PC is updated to point to the target address. Executes in A32 only.
Pseudocode Operation
if condition_satisfied then
PC ← PC + (sign_extend(imm24) << 2) + 8
Example
B label
Encoding
Binary Layout
cond
101
0
imm24
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);