Chapter 6 Instruction Details
XBC E-Type Main Unit 6-140 Ve r. 1
6.25 Rotation Instruction
6.25.1 ROL, ROLP, DROL, DROLP
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]
Flag Description
If Carry is caused during rotation, Carry Flag will be set.
1) ROL (Rotate Left)
(1) Rotates D’s 16 Bits for the number of bits specified to the left, bit by bit. The highest bit will rotate to Carry
Flag (F112) and the lowest bit. (Rotation within 1 word)
2) DROL (Double Rotate Left)
(1) Rotates D and D+1’s 32 Bits data for n bits to the left, not including Carry Flag.
b30 b
29 b28 b27 b18
b17 b16 b15 b14b31
b5 b4 b3 b2 b1 b0
Rotation for n bits
(F112)
Carry Flag
D+1
D
3) Program Example
(1) For P1000=h1234, when Input signal P00000 is changed to On from Off status, it rotates 4 bits to the left
bit by bit and then h2341 will be saved in P1000.