IBM SA14-2339-04 Personal Computer User Manual


 
Programming Model 2-25
For the relative (AA = 0) forms (bc, bcl), the target address is the CIA plus the signed displacement.
For the absolute (AA = 1) forms (bca, bcla), the target address is 0 plus the signed displacement. If
the sign bit (BD[0]) is 0, the displacement is the target address. If the sign bit is 1, the displacement is
negative and wraps to the highest memory addresses. For example, if the displacement is 0xFFFC
(the 16-bit representation of –4), the target address is 0xFFFF FFFC (0 – 4B, or 4 bytes from the top
of memory).
2.7.3 Conditional Branch Condition Register Testing
Conditional branch instructions can test a CR bit. The value of the BI field specifies the bit to be tested
(bit 0–31). The BO field controls whether the CR bit is tested, as described in the following section.
2.7.4 BO Field on Conditional Branches
The BO field of the conditional branch instruction specifies the conditions used to control branching,
and specifies how the branch affects the CTR.
Conditional branch instructions can test one bit in the CR. This option is selected when BO[0] = 0; if
BO[0] = 1, the CR does not participate in the branch condition test. If this option is selected, the
condition is satisfied (branch can occur) if CR[BI] = BO[1].
Conditional branch instructions can decrement the CTR by one, and after the decrement, test the
CTR value. This option is selected when BO[2] = 0. If this option is selected, BO[3] specifies the
condition that must be satisfied to allow a branch to be taken. If BO[3] = 0, CTR 0 is required for a
branch to occur. If BO[3] = 1, CTR = 0 is required for a branch to occur.
If BO[2] = 1, the contents of the CTR are left unchanged, and the CTR does not participate in the
branch condition test.
Table 2-6 summarizes the usage of the bits of the BO field. BO[4] is further discussed in “Branch
Prediction.”
Table 2-6. Bits of the BO Field
BO Bit Description
BO[0] CR Test Control
0 Test CR bit specified by BI field for value specified by BO[1]
1 Do not test CR
BO[1] CR Test Value
0 Test for CR[BI] = 0.
1 Test for CR[BI] = 1.
BO[2] CTR Test Control
0 Decrement CTR by one and test whether CTR satisfies the
condition specified by BO[3].
1 Do not change CTR, do not test CTR.
BO[3] CTR Test Value
0 Test for CTR 0.
1 Test for CTR = 0.
BO[4] Branch Prediction Reversal
0 Apply standard branch prediction.
1 Reverse the standard branch prediction.