Table of Contents Previous topic Next topic
MICROPROCESSOR INSTRUCTION REFERENCE->CAS
CAS Compare and Swap with Operand
Compatibility: 68020 only
Destination - Compare Operand -> Condition Codes
If Zero Flag set, Update Operand -> Destination
else Destination -> Compare Operand
Assembler Syntax: CAS Dc,Du,<ea>
Size: Byte, Word, Long
The effective address operand is compared with the compare operand (Dc). If the operands are equal, the update operand (Du) is written to the effective address operand, otherwise the effective address operand is written to the compare operand (Dc).
Condition Codes:
N Set if result negative, else cleared
Z Set if result zero, else cleared
V Set if overflow, else cleared
C Set if borrow generated, else cleared
X Not affected
This instruction is not supported by CPU32 based microcontrollers.
Allowable Addressing Modes |
CAS | Dc,Du,(An) | |
CAS | Dc,Du,(An)+ | |
CAS | Dc,Du,-(An) | |
CAS | Dc,Du,(d16,An) | |
CAS | Dc,Du,(d8,An,Xn) | |
CAS | Dc,Du,(bd,An,Xn) | |
CAS | Dc,Du,([bd,An,Xn],od) | |
CAS | Dc,Du,([bd,An],Xn,od) | |
CAS | Dc,Du,(xxx).W | |
CAS | Dc,Du,(xxx).L |