XOR


ANSI

 

The XOR instruction performs a logical 'exclusive or' of the source with the destination and stores the result over the destination. It uses one of the following formats:

 

(1)

[label]

XOR

{source1}{sep}{dest1}

(2)

[label]

XOR

{source2}{sep}{dest2}

 

Where:

label

Optional. A Program Execution Label.

source1

Required. A previously defined Character String Variable single character Literal decimal constant or equivalent {ctrl} character that is combined with the {dest} operand.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

dest1

Required. A previously defined Character String Variable that is combined with the {source} operand.

source2

Required. A previously defined INTEGER variable that is combined with the {dest} operand.

dest2

Required. A previously defined INTEGER that is combined with the {source} operand.

Flags Affected: EOS, ZERO

Note the following:

  1. The {source} is unchanged.

  2. If {source} is a string variable, the source Form Pointed character is processed against the destination Form Pointed character. The result is stored in the destination Form Pointed character.

  3. If {source} is an integer variable, the entire {source} integer field is processed against the entire {dest} integer field, and the result is placed in the {dest} integer field.

  4. If either {source} or {dest} is a Null String, the EOS Condition Flag is set.

  5. If the result is zero, the ZERO Condition Flag is set.

  6. The following truth table indicates the results of the operation on each bit:

  7.  

    Source

    Dest

    Result

    0

    0

    0

    0

    1

    1

    1

    0

    1

    1

    1

    0

  1. Any bit in the character may be manipulated (not just those below octal 200 or hex 80).

  2. Enhanced ARRAY processing is supported for the XOR instruction.

 

 

See Also: Example Code, AND, NOT, OR, TEST, Character String Instructions

 



PL/B Language Reference WHEREIS, WHEREISLAST