bl
Branch and Link
Branches to a target address and saves the return address (CIA + 4) in the Link Register (LR). Used for function calls.
Details
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.
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.
Example
// Call 'printf' function.
Encoding
Operands
-
LI
24-bit Signed Immediate