Rev. 1.50, 10/04, page 277 of 448
10.1.36 MOVCO (Move Conditional): Data Transfer Instruction
Format Operation Instruction Code Cycle T Bit
MOVCO.L R0,@Rn LDST → T
if (T==1) R0 → (Rn)
0 → LDST
0000nnnn01110011 1 LDST
Description: MOVCO is used in combination with MOVLI to realize an atomic read-modify-
write operation in a single processor.
This instruction copies the value of the LDST flag to the T bit. When the T bit is set to 1, the value
of R0 is stored at the address in Rm. If the T bit is cleared to 0, the value is not stored at the
address in Rm. Finally, the LDST flag is cleared to 0. Since the LDST flag is cleared by an
instruction or exception, storage by the MOVCO instruction only proceeds when no interrupt or
exception has occurred between the execution of the MOVLI and MOVCO instructions.
Notes: None
Operation:
MOVCO(long n) /* MOVCO Rn,@Rn */
{
T = LDST;
if(T==1)
Write_Long(R[n],R[0]);
LDST = 0;
PC += 2
}