Condition Code

The condition code is stored in the PSW as a 2-bit binary number, therefore it may contain the four values: 0, 1, 2, 3.

The branch-on-condition instructions BC and BCR contain a 4-bit immediate mask field.  The bit numbers of the mask bits correspond to the four CC values.  The instructions test the current CC for any of the values represented by the mask bits that equal B'1'.  If a match is found, the branch is taken.  Therefore, setting multiple 1-bits in the mask directs the instructions to take the branch for any of several condition codes.

CC Mask  Coded Mask 
0 1000 BC 8,DEST
1 0100 BC 4,DEST
2 0010 BC 2,DEST
3 0001 BC 1,DEST
 0 or 3  1001 BC 9,DEST
Not 0 0111 BC 7,DEST
Not 3 1110 BC 14,DEST
Any 1111 BC 15,DEST
None 0000 BC 0,DEST

The branch extended-mnemonic B is implemented as the BC instruction with all 4 mask bits set to 1:

         B     DEST                      THE SAME INSTRUCTION
         BC    15,DEST

A null BC instruction takes effect for no value of CC.

         BC    0,DEST                    GOING NOWHERE

Copyright © 2006 The Stevens Computing Services Company, Inc.  All rights reserved.