CAS

CAS

Operation:
CAS Destination -- Compare Operand -->; cc;
if Z, Update Operand -->; Destination
else Destination -->; Compare Operand

Assembler Syntax:
CAS Dc, Du, <ea>

Attributes: Size = (Byte, Word, Long)

Description: CAS compares the effective address operand to
the compare operand (Dc). If the operands are equal, the
instruction writes the update operand (Du) to the effective
address operand; otherwise, the instruction writes the
effective address operand to the compare operand (Dc).
The instruction accesses memory using locked or read-
modify-write transfer sequences. This provides a means
of synchronizing several processors.

Condition Codes:
\c32222
X Not affected.
N Set if the result is negative. Cleared otherwise.
Z Set if the result is zero. Cleared otherwise.
V Set if an overflow is generated. Cleared otherwise.
C Set if a borrow is generated. Cleared otherwise.

Notes:
The CAS and CAS2 instructions can be used to perform secure
update operations on system control data structures in
a multiprocessing environment.