335
DROR, DRORP, DRCR, DRCRP
1
2
3
4
4
6
7
8
7.2
R
otation instr
uction
7.2.3
DROR, DR
OR
P,
DRCR, D
RCRP
(2) The following program rotates the contents of D0, including the carry flag, 3 bits to the left when XC is turned ON.
[Ladder Mode]
[List Mode]
[Operation]
: Head number of the devices to rotate (BIN 32 bits)
n
: Number of rotations (0 to 31) (BIN 16 bits)
Function
DROR
(1) The 32-bit data of the device designated at , not including the carry flag, is rotated n-bits to the right.
The carry flag turns ON or OFF depending on its status prior to the execution of the DROR 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".
7.2.3
DROR, DRORP, DRCR, Right rotation of 32-bit data
DRCRP
7.2.3
DROR, DRORP, DRCR, DRCRP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
n
––
Step
Instruction
Device
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
b15
b8
b0
b7
b0
b7
b15
b8
1
*
b1
4
b13 b12 b11b10 b9
b6 b5 b
4
b3 b2 b1
b1
4
b13 b12 b11b10 b9
b6 b5 b
4
b3 b2 b1
Carr
y
f
l
ag
(
SM700
)
Carr
y
f
l
ag
(
SM700
)
Contents
of
b15
and
b1
4
before
execut
i
on
Contents
of
b11
to
b0
before
execut
i
on
Content
of
b12
before
execut
i
on
Content
of
b13
before
execut
i
on
Content
of
carr
y
f
l
ag
SM700
D0
D0
1
*
O
N/
O
FF
status
of
the
carr
y
f
l
ag
depends
on
i
ts
status
before
the
execut
i
on
of
RC
L.
*
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
D
n
D
n
DROR, DRCR
DRORP, DRCRP
indicates an instruction s
y
mbol of DROR/DRCR.
D
D
D
b2
b16
b31
b17
b30 b29 b28 b27
b18
b15 b1
4
b5 b
4
b3
Carr
y
f
l
ag
(
SM700
)
b1 b0
+
1
n
-
b
i
t
rotat
i
on
D
D
D