Chapter 6 Instruction Details
XBC E-Type Main Unit 6-141 Ve r. 1
6.25.2 ROL4, ROL4P, ROL8, ROL8P
Instruction
Step
P M K F L T C S Z D.x
R.x
U N D R
2~4 - - O
Data address to perform operation.
Number of bits to rotate to the left.
[Flag Set]
If Carry is caused during rotation, Carry Flag will be set.
1) ROL4( Rotate Left)
(1) Rotates D’s 4 bits for the number of n bits specified to the left bit by bit. The highest bit among 4 bits will
rotate to Carry Flag and the lowest bit. (Rotation within 4 bits)
(2) If Carry is caused during rotation, Carry Flag will be set.
2) ROL8 (Double Rotate Left)
(1) Rotates D’s 8 bits for the number of n bits specified to the left bit by bit. The highest bit among 8 bits will
rotate to Carry Flag and the lowest bit. (Rotation within 8 bits)
(2) If Carry is caused during rotation, Carry Flag will be set.
3) Program Example
(1) For P01004~P01007=h3, when Input Signal P00000 is changed to On from Off status, it rotates 2 bits to
the left bit by bit, and then ‘hc’ will be saved in P01004~P01007.