caxi


Comparison and swap (Compare and Exchange for Interlock)

[Syntax]

-

caxi [reg1], reg2, reg3

[Function]

Word data is read from the specified address and compared with the word data in general-purpose register reg2, and the result is indicated by flags in the PSW. Comparison is performed by subtracting the read word data from the word data in general-purpose register reg2. If the comparison result is "0", word data in general-purpose register reg3 is stored in the generated address, otherwise the read word data is stored in the generated address.

Afterward, the read word data is stored in general-purpose register reg3. General-purpose registers reg1 and reg2 are not affected.

[Description]

-

The assembler generates one caxi machine instruction.

[Flag]

CY

"1" if a borrow occurs in the result operation; otherwise, "0"

OV

"1" if overflow occurs in the result operation; otherwise, "0"

S

"1" if result is negative; otherwise, "0"

Z

"1" if result is 0; otherwise, "0"

SAT

---