bl
Branch and Link
bl target_addr
Branches to a target address and saves the return address (CIA + 4) in the Link Register (LR). Used for function calls.
Encoding
Binary Layout
18
0:5
LI
6:29
AA
30
1
31
Operands
-
LI
24-bit Signed Immediate
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
Branches to a target address calculated from the 24-bit signed immediate and saves the return address (CIA + 4) in the Link Register (LR). The AA bit determines whether the address is absolute or relative. This is the standard instruction for subroutine calls.
Operation
if AA = 0 then NIA ← CIA + (LI || 0b00) else NIA ← (LI || 0b00)
LR ← CIA + 4
Programming Note
The bl instruction is commonly used for function calls where a return to the caller is required. Ensure that the target address is correctly calculated and aligned, as misalignment can lead to exceptions. The link register (LR) must be preserved if nested subroutine calls are made to maintain correct return paths.