The Or Immediate instruction performs a logical bit by bit “or” between a byte in memory and an immediate constant.  Operand 1, the target,  is a byte in memory and Operand 2, the source, specifies the immediate constant.  The byte in memory is or-ed internally with the immediate constant and contains the final result.  The immediate constant is not changed.  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 Immediates

 

              BYTE1  DC   X’00’

              BYTE2  DC   X’FF’

              BYTE3  DC   X’C3’

 

       OI    BYTE1,X’12’         BYTE1 = X’12’    Condition Code = 1

       OI    BYTE1,X’FF’         BYTE1 = X’FF’    Condition Code = 1

       OI    BYTE1,C’A’          BYTE1 = X’C1’    Condition Code = 1

       OI    BYTE1,B’11110000’   BYTE1 = X’F0’    Condition Code = 1

       OI    BYTE1,B’00000000’   BYTE1 = X’00’    Condition Code = 0

       OI    BYTE2,X’12’         BYTE2 = X’FF’    Condition Code = 1

       OI    BYTE2,X’FF’         BYTE2 = X’FF’    Condition Code = 1

       OI    BYTE2,C’A’          BYTE2 = X’FF’    Condition Code = 1

       OI    BYTE2,B’11110000’   BYTE2 = X’FF’    Condition Code = 1

       OI    BYTE3,X’12’         BYTE3 = X’D3’    Condition Code = 1

       OI    BYTE3,X’FF’         BYTE3 = X’FF’    Condition Code = 1

       OI    BYTE3,C’A’          BYTE3 = X’C3’    Condition Code = 1

       OI    BYTE3,B’11110000’   BYTE3 = X’F3’    Condition Code = 1