And (AND)

Instruction Syntax

Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 Operand [4-5]
AND 1093 Receiver Source 1 Source 2
ANDI 1893 Indicator options Receiver Source 1 Source 2 Indicator targets
ANDB 1C93 Branch options Receiver Source 1 Source 2 Branch targets
Operand 1: Character variable scalar or numeric variable scalar.

Operand 2: Character scalar or numeric scalar.

Operand 3: Character scalar or numeric scalar.

Operand 4-5:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

Short forms

Op Code (Hex) Extender Operand 1 Operand 2 Operand [3-4]
ANDS 1193 Receiver/Source 1 Source 2
ANDIS 1993 Indicator options Receiver/Source 1 Source 2 Indicator targets
ANDBS 1D93 Branch options Receiver/Source 1 Source 2 Branch targets
Operand 1: Character variable scalar or numeric variable scalar.

Operand 2: Character scalar or numeric scalar.

Operand 3-4:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

Description:

The Boolean and operation is performed on the string values in the source operands. The resulting string is placed in the receiver operand. The operands may be character or numeric scalars. They are both interpreted as bit strings. Substringing is supported for both character and numeric operands.

The length of the operation is equal to the length of the longer of the two source operands. The shorter of the two operands is logically padded on the right with hex 00 values. This assigns hex 00 values to the results for those bytes that correspond to the excess bytes of the longer operand.

The bit values of the result are determined as follows:

Source 1 Bit Source 2 Bit Result Bit
0 0 0
0 1 0
1 0 0
1 1 1

The result value is then placed (left-adjusted) in the receiver operand with truncating or padding taking place on the right. The pad value used in this instruction is a byte value of hex 00.

If operands overlap but do not share all of the same bytes, results of operations performed on these operands are not predictable. If overlapped operands share all of the same bytes, the results are predictable when direct addressing is used. If indirect addressing is used (that is, based operands, parameters, strings with variable lengths, and arrays with variable subscripts), the results are not always predictable.

Substring operand references that allow for a null substring reference (a length value of zero) may be specified for operands 1, 2, and 3. The effect of specifying a null substring reference for either or both of the source operands is that the result is all zero and the instruction's resultant condition is zero. When a null substring reference is specified for the receiver, a result is not set and the instruction's resultant condition is zero regardless of the values of the source operands.

When the receiver operand is a numeric variable scalar, it is possible that the result produced will not be a valid value for the numeric type. This can occur due to padding with hex 00, due to truncation, or due to the resultant bit string produced by the instruction. The instruction completes normally and signals no exceptions for these conditions.

Resultant Conditions

  • Zero - The bit value for the bits of the scalar receiver operand is either all zero or a null substring reference is specified for the receiver.
  • Not zero - The bit value for the bits of the scalar receiver operand is not all zero.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2C Program Execution
    • 2C04 Branch Target Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed