Download FA-M3 Programming Tool WideField3 (Script)

Transcript
G9-5
 Function and Example
This function rotates a 16-bit or 32-bit data left by n bits.
"Left Rotate Word" is used (with a prefix of W) when a rotation of a 16-bit data is
performed. "Left Rotate Long-word" is used (with a prefix of L) when a rotation of a 32bit data is performed. The carry flag is changed according to the result of the rotation.
 Example
W.Y00601 = LROT(W.X00501, 2)
X00516
X00501
0 1 0 0 0 0 1 1 0 1 0 0 1 0 0 1
From (1)
Carry
2-bit left rotation
0
X00501
Intermediate
processes
(1) 1 0 0 0 0 1 1 0 1 0 0 1 0 0 1 0
From (2)
1
(2)
0 0 0 0 1 1 0 1 0 0 1 0 0 1 0 1
Y00616
Figure G9.2
Y00601
Y00601
G0902_01.VSD
Example and Behavior of the LROT Function
SEE ALSO
The LROT function behaves in the same way as the LROT instruction in ladder instructions. For details
on the LROT instruction, see Section 3.5.1, "Rotate (RROT, LROT), Rotate Long-word (RROT L, LROT
L)" in "Sequence CPU Instruction Manual - Instructions" (IM 34M06P12-03E).
IM 34M06Q16-04E
3rd Edition: Dec. 25, 2013-00