bl
Branch with Link (A32)
BL<c> <label>
Calls a subroutine, storing return address in LR (R14).
Pseudocode Operation
if condition_satisfied then
LR ← PC + 4
PC ← PC + (sign_extend(imm24) << 2) + 8
Example
BL label
Encoding
Binary Layout
cond
31:28
101
27:25
1
24
imm24
23:0
Operands
-
label
Label
Reference
View in Arm A64 ISA Reference ↗
Arm AArch32 ISA
Instruction Forms
| Encoding | Instruction | ISA | Bit pattern | ||
|---|---|---|---|---|---|
| 0x0B000000 | BL{<c>}{<q>} <label> | A32 | cond | 101 | 1 | imm24 | ||
| 0xF000D000 | BL{<c>}{<q>} <label> | T32 | 11110 | S | imm10 | 11 | J1 | 1 | J2 | imm11 |
Description
Branch with Link calls a subroutine at a PC-relative address, and setting LR to the return address. Branch with Link and Exchange Instruction Sets (immediate) calls a subroutine at a PC-relative address, setting LR to the return address, and changes the instruction set from A32 to T32, or from T32 to A32.
Operation
if ConditionPassed() then
EncodingSpecificOperations();
if CurrentInstrSet() == InstrSet_A32 then
LR = PC - 4;
else
LR = PC<31:1> : '1';
bits(32) targetAddress;
if targetInstrSet == InstrSet_A32 then
targetAddress = Align(PC,4) + imm32;
else
targetAddress = PC + imm32;
SelectInstrSet(targetInstrSet);
BranchWritePC(targetAddress, BranchType_DIRCALL);