bl.w

Branch with Link (Wide)

BL.W <label>

Thumb-2 32-bit Branch with Link.

Pseudocode Operation

if ConditionPassed() then
  LR ← PC + 4 | 1
  offset ← SignExtend(S || imm10 || J1 || J2 || imm11, 24)
  PC ← PC + (offset << 1)

Example

BL.W label

Encoding

Binary Layout
11110
31:27
S
26
imm10
25:16
11
15:14
J1
13
1
12
J2
11
imm11
10:0
 
Format Thumb Branch
Opcode 0xF000D000
Extension T32 (Thumb2)

Operands

  • label
    Label

Related

More in T32 (Thumb2)

Reference

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);