Table of Contents

Logical AND (AND)/OP=42

Format

OP AF BF A Syllable B Syllable C Syllable

OP = 42

AF is the length of the A Syllable field. AF may be indirect or may indicate the A Syllable is a literal. A value of 00 is equal to a length of 100 units.
BF is the length of the B Syllable field. BF may be indirect. A value of 00 is equal to a length of 100 units.

The A Syllable is the address of the A source field. Address may be indexed, indirect or extended. The final address controller data type must be UN or UA and must be the same as the other address controllers.
The B Syllable is the address of the B source field. Address may be indexed, indirect or extended. The final address controller data type must be UN or UA and must be the same as the other address controllers.
The C Syllable is the address of the result field. Address may be indexed, indirect or extended. The final address controller data type must be UN or UA and must be the same as the other address controllers.

If the data types are not all UA or all UN cause an Invalid Instruction (IEX = 03) fault. See Compatibility Notes A.11.1.

Function

The Logical AND instruction stores the logical product (AND) of two data fields (A & B), located in memory, into a third memory location (C).

The C field length is equal to the larger of AF or BF. If the A and B fields are not of equal length, pad the shorter by adding trailing characters/digits of all zero bits.

Comparison Flags

Set the Comparison Flags to HIGH if the least significant bit of the result is a one; otherwise, set them to EQUAL.

Overlap

Total overlap or matching type-address overlap of any of the fields is allowed. Partial overlap of the A or B fields with C other than matching type-address overlap may produce incompatible results. See Compatibility Notes A.11.2.

Examples

Example (1) AND Two Numeric Fields

OP AF BF A Syllable B Syllable C Syllable
42 02 03 A field (UN) B field (UN) C Field (UN)
                    BEFORE         AFTER
  A FIELD             F6         unchanged 
  B FIELD            235         unchanged
  C FIELD            nnn            220
  COMPARISON          nn           EQUAL

Example (2) AND Two Alpha Fields

OP AF BF A Syllable B Syllable C Syllable
42 02 03 A field (UA) B field (UA) C field (UA)
                    BEFORE         AFTER
  A FIELD            E7E8        unchanged
  B FIELD          D4D8D1        unchanged
  C FIELD          nnnnnn         C4C800
  COMPARISON          nn            EQUAL