bl

Branch with Link

BL <label>

Function call. Branches to label and stores return address in LR (X30).

Details

Branch with link: unconditional branch to a PC-relative label and stores the return address (current PC + 4) in the link register X30 (LR). The 26-bit signed immediate is shifted left by 2 and added to the current PC. No condition flags are affected. This is an AArch64-only instruction.

Pseudocode Operation

LR ← PC + 4
PC ← PC + (SignExtend(imm26, 64) << 2)

Example

BL label

Encoding

Binary Layout
1
00101
imm26
 
Format Branch
Opcode 0x94000000
Extension Base

Operands

  • label
    Label

Reference (Arm A64 ISA)

Instruction Forms

Encoding Instruction ISA Bit pattern
0x94000000 BL <label> A64 1 | 00101 | imm26

Description

Branch with Link branches to a PC-relative offset, setting the register X30 to PC+4. It provides a hint that this is a subroutine call.

Operation

if IsFeatureImplemented(FEAT_GCS) && GCSPCREnabled(PSTATE.EL) then
    AddGCSRecord(PC64 + 4);
X[30, 64] = PC64 + 4;

BranchTo(PC64 + offset, BranchType_DIRCALL, FALSE);