The Or Character instruction performs a logical bit by bit “or” between two fields in memory. Operand 1, the target,  is a memory field and Operand 2, the source, also specifies a storage location in memory.  The number of characters which participate in the operation is determined by the first operand, and as a result, is limited to 256 bytes.  The storage fields are or-ed internally with the result placed in the target field. Typically, the source is unaffected, but can be altered by this operation if the fields overlap.  The table below shows the results of “or-ing” two bits together.

 

                                                       Bit 1      Bit 2    Result

                                                          0           0            0

                                                          0           1            1

                                                          1           0            1

                                                          1           1            1

 

   This instruction sets the condition code as follows:

 

                 0  if all target bits are set to 0.  Test this condition with BZ or BNZ.

                 1  if any target bit is set to 1.  Test this condition with BM or BNM.

 

        Some Unrelated Or Characters

 

              FIELD1  DC   X’0001020304’

              FIELD2  DC   X’FFFFFF’

              FIELD3  DC   C’ABC’

              FIELD4  DC   X’000000’

 

     OC    FIELD1,FIELD1    FIELD1 = X’0001020304’ Condition Code = 1

     OC    FIELD2,FIELD1    FIELD2 = X’FFFFFF’     Condition Code = 1

     OC    FIELD3,FIELD1    FIELD3 = X’C1C3C3’     Condition Code = 1

     OC    FIELD2,FIELD3    FIELD2 = X’FFFFFF’     Condition Code = 1

     OC    FIELD4,FIELD4    FIELD4 = X’000000’     Condition Code = 0

     OC    FIELD3,FIELD4    FIELD3 = X’C1C2C3’     Condition Code = 1

     OC    FIELD1+2,FIELD3  FIELD1 = X’0001C3C3C7’ Condition Code = 1

     OC    FIELD1(3),FIELD2 FIELD1 = X’FFFFFF0304’ Condition Code = 1