ba

Branch Absolute

ba target_addr

Unconditionally branches to an absolute address.

Details

Unconditionally branches to an absolute address formed by sign-extending the 24-bit immediate LI and shifting left by 2 bits. The Link Register is not modified unless LK=1. This instruction does not check any condition bits.

Pseudocode Operation

NIA ← (LI || 0b00)
if LK = 1 then LR ← CIA + 4

Programming Note

When LK=1, the address of the next sequential instruction is placed in LR, making this a subroutine call. Use blr to return.

Example

ba 0x1000

// Jump to address 0x1000.

Encoding

Binary Layout
18
0
LI
6
1
30
LK
31
 
Format I-form
Opcode 0x48000002
Extension Base

Operands

  • LI
    24-bit Signed Immediate (Address / 4)