bctar

Branch Conditional to Target Address Register

bctar BO,BI,BH (LK=0)

Conditional branch based on the contents of the Condition Register and the Count Register.

Encoding

Binary Layout
19
0:5
BO
6:10
BI
11:15
/
16:18
BH
19:20
560
21:30
/
31
 
Format XL-form
Opcode 0x4C000460
Extension Base

Operands

  • BO
    Options
  • BI
    CR Bit
  • BH
    Hint

Example

bctar 20, 0, BH (LK=0)

Registers Altered

CTR, LR

Related

More in Base

Reference

Description

Performs a conditional branch to the target address held in the Target Address Register (TAR). The branch condition is determined by the values of the Branch Options (BO) field and the Condition Register bit (BI). The Count Register may also influence the branch condition depending on BO. No status flags are updated; the instruction may update the Link Register if suffixed with LK=1.

Operation

if condition(BO, BI, CTR) then
  NIA ← TAR
else
  NIA ← CIA + 4

Programming Note

In some systems, the system software will restrict usage of the bctar[l] instruction to only selected programs. If an attempt is made to execute the instruction when it is not available, the system error handler will be invoked.