AND


ANSI

 

The AND instruction provides bit manipulation by logically ANDing the source with the destination and storing the result over the destination. It uses one of the following formats:

 

(1)

[label]

AND

{source1}{sep}{dest1}

(2)

[label]

AND

{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 ANDed 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 ANDed with the {source} operand contains the results.

source2

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

dest2

Required. A previously defined INTEGER that is ANDed with the {source} operand contains the results.

Flags Affected: EOS, ZERO

Note the following:

  1. The {source} operand remains unchanged.

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

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

  4. Any bit in the character may be manipulated.

  5. Enhanced ARRAY processing is supported for the AND instruction.

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

  7. Source

    Dest

    Result

    0

    0

    0

    0

    1

    0

    1

    0

    0

    1

    1

    1

 

 

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

 



PL/B Language Reference Character String Instructions APPEND