Contents | < Browse | Browse >
NAME
CAS2 --Compare and swap (two-operand) (68020+)
SYNOPSIS
CAS2 Dc1:Dc2,Du1:Du2,(Rn1):(Rn2)
Size = (Word, Long)
FUNCTION
This instruction is a read-modify-write instruction and should
NEVER be used on Amiga because of conflicts with customs chips
Destination operand 1, which is in memory to specified address by
(Rn1), is compared to data register Dc1. If there's equality (Z=1),
destination operand 2, which is in memory to specified address by
(Rn2), is compared to data register Dc2.
If there's equality (Z=1), destination operand 1 can be updated, i.e.
new operand Du1 (Data Update) is moved in destination (Rn1).
And also, destination operand 2 can be updated, i.e. new operand Du2
(Data Update) is moved in destination (Rn2).
If there's no equality (Z=0), reference registers Dc1 and Dc2 have to
be updated. So there's move from destination operand (Rn1) in Dc1, and
from (Rn2) in Dc2.
FORMAT
------------------------------------------------------------------
| 15 |14 |13 |12 |11 |10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|----|---|---|---|---|-------|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | SIZE | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
|----|-----------|---|-------|-----------|---|---|---|-----------|
|D/A1| Rn1 REG. | 0 | 0 | 0 | Du1 REG. | 0 | 0 | 0 | Dc1 REG. |
|----|-----------|---|---|---|-----------|---|---|---|-----------|
|D/A2| Rn2 REG. | 0 | 0 | 0 | Du2 REG. | 0 | 0 | 0 | Dc2 REG. |
------------------------------------------------------------------
SIZE
10->one Word operation
11->one Long operation
REGISTER
D/A1 = 0: Rn1=Dn
D/A1 = 1: Rn1=An
D/A2 = 0: Rn2=Dn
D/A2 = 1: Rn2=An
Du1, Du2 registers: indicates number of data register, which contains
the new value to update in destination operand.
Dc1, Dc2 registers: indicates number of data register, which contains
the reference value to compare to destination operand.
Rn1, Rn2 registers: indicates number of destination registers.
RESULT
X - not affected
N - Set following to comparisons results.
Z - Set if the result of comparisons is zero. Cleared otherwise.
V - Set if overflow. Cleared otherwise.
C - Set if carry. Cleared otherwise.
SEE ALSO
CAS