7-42
DROR(P),DRCR(P)
DRCR
(1) Rotates 32-bit data, including carry flag, at device designated by n bits to the right.
The carry flag goes ON or OFF depending on its status prior to the execution of the DRCR
instruction.
(2) When a bit device is designated for , a rotation is performed within the device range
specified by digit specification. The number of bits by which a rotation is executed is the
remainder of n /(specified number of bits).
For example, when n 31 and (specified number of bits) 24 bits, the remainder of 31/24
1 is "7", and the data is rotated 7 bits.
(3) Specify any of 0 to 31 as n. If the value specified as n is 32 or greater, the remainder of n /
32 is used for rotation. For example, when n 34, the contents are rotated two bits to the
right since the remainder of 34 / 32 1 is "2".
Operation Error
(1) There are no operation errors associated with the DROR(P) or DRCR(P) instruction.
Program Example
(1) The following program rotates the contents of D0 and D1, not including the carry flag, 4 bits
to the right when XC is ON.
[Ladder Mode] [List Mode]
[Operation]
D
b2b16b31 b17b30b29b28b27 b18 b15b14
b5
b4 b3
Carry flag
(SM700)
b1 b0
D D
n-bit rotation
+1
D
Step Instruction Device
0
D0, D1
0001111000011110000111100001111
1
D0, D1
11
10000111100001111000011110000
b31 b16 b0b15b28 b27 b24b23 b20b19 b12 b11 b8 b7 b4 b3
Contents of b3 to b0
before execution
b31 b16 b0b15b28 b27 b24 b23 b20 b19 b12 b11 b8 b7 b4 b3
Contents of b31 to b4
before execution
0
1
Carry flag
(SM700)
Carry flag
(SM700)
Content of b3
before execution