9-26 PPC405 Core User’s Manual
bcctr
Branch Conditional to Count Register
bcctr
Branch Conditional to Count Register
if BO
2
= 0 then
CTR
← CTR–1
if (BO
2
= 1 ∨ ((CTR = 0) = BO
3
)) ∧ (BO
0
=1∨ (CR
BI
=BO
1
)) then
NIA
← CTR
0:29
||
2
0
else
NIA
← CIA + 4
if LK = 1 then
(LR)
← CIA+4
PC
← NIA
The BI field specifies a bit in the CR to be used as the condition of the branch.
The next instruction address (NIA) is the target address of the branch. The NIA is formed by
concatenating the 30 most significant bits of the CTR with two 0-bits on the right.
The BO field controls options that determine when program flow is transferred to the NIA. The BO
field also controls branch prediction, a performance-improvement feature. See “Branch Prediction” on
page 2-26 for a complete discussion.
If the LK field contains 1, then (CIA + 4) is placed into the LR.
Registers Altered
• CTR if BO
2
contains 0
• LR if LK contains 1
Invalid Instruction Forms
• Reserved fields
• If bit 2 of the BO field contains 0, the instruction form is invalid, but the pseudocode applies. If the
branch condition is true, the branch is taken; the NIA is the contents of the CTR after it is
decremented.
Architecture Note
This instruction is part of the PowerPC User Instruction Set Architecture.
bcctr BO, BI LK = 0
bcctrl BO, BI LK =1
19 BO BI 528 LK
0 6 11 16 21 31