
The And Character instruction performs a logical bit by bit
“and” between two fields in memory. Operand 1, the target, is a memory field and Operand 2, the source,
also specifies a storage location in memory.
The number of characters which participate in the operation is
determined by the first operand, and as a result, is limited to 256 bytes. The storage fields are “and-ed” internally
with the result placed in the target field. Typically, the source is
unaffected, but can be altered by this operation if the fields overlap. The table below shows the results of
“and-ing” two bits together.
Bit 1
Bit 2 Bit 1 and Bit 2
0
0 0
0 1 0
1 0 0
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 And Characters
FIELD1 DC X’0001020304’
FIELD2 DC X’FFFFFF’
FIELD3 DC C’ABC’
FIELD4 DC X’000000’
FIELD5 DC B’10101111’
FIELD6 DC B’10001001’
NC
FIELD1,FIELD1 FIELD1 =
X’0001020304’ Condition Code = 1
NC
FIELD2,FIELD1 FIELD2 =
X’000102’ Condition Code = 1
NC
FIELD3,FIELD1 FIELD3 = X’000102’ Condition Code = 1
NC
FIELD2,FIELD3 FIELD2 =
X’C1C2C3’ Condition Code = 1
NC
FIELD4,FIELD4 FIELD4 =
X’000000’ Condition Code = 0
NC
FIELD3,FIELD4 FIELD3 =
X’000000’ Condition Code = 0
NC
FIELD1+2,FIELD3 FIELD1 =
X’0001000200’ Condition Code = 1
FIELD2 =
X’0000FFFF’
NC
FIELD1(3),FIELD2 FIELD1 = X’0001020304’ Condition Code = 1
NC
FIELD5,FIELD6 FIELD5 =
B’10001001’ Condition Code = 1