291
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Data Movement Instructions
3
MOVD
Flags
Function
Hint
The same word can be specified for both S and D to copy a bit within a word.
Precautions
If the number of digits being read or written exceeds the leftmost digit of S or D, MOVD(083) will wrap to
the rightmost digit of the same word.
Example Programming
When CIO 0.00 is ON in the following example, four digits of data are copied from CIO 200 to CIO 300.
The transfer begins with the digit 1 of CIO 200 and digit 0 of CIO 300, in accordance with the control
word's value of 31.
Note After reading the leftmost digit of S (digit 3), MOVD(083) wraps to the rightmost digit (digit 0).
z Example of transferring multiple digits
The following diagram shows examples of data transfers for various values of C.
Name Label Operation
Error Flag ER • ON if one of the first three digits of C is not within the specified range of 0 to 3.
• OFF in all other cases.
MOVB(082) copies the specified bit (n) from S
to the specified bit (m) in D. The other bits in
the destination word are left unchanged.
Digit no.
Digit no.
First digit in D: Digit 0
Number of digits: 3 (4 digits)
First digit in S: Digit 1
D:300
S:200
C:D300
200
D300
300
0.00