3. Instruction Set
3-91
API Mnemonic Operands Function
30
D ROR P Rotation Right
Controllers
ES2/EX2 SS2 SA2
SE SX2
Bit Devices Word devices Program Steps Type
OP X Y M S K H KnXKnY KnM KnS T C D E F
D ** * * * ***
n * *
ROR, RORP: 5 steps
DROR, DRORP: 9 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2 SA2
SE SX2 ES2/EX2 SS2 SA2
SE SX2 ES2/EX2 SS2 SA2
SE SX2
Operands:
D: Device to be rotated n: Number of bits to be rotated in 1 rotation
Explanations:
1. This instruction rotates bit status of the device D to the right for n bits
2. The status of the last bit rotated (marked with) is copied to the carry flag M1022 (Carry
flag)
3. This instruction is generally used in pulse execution mode (RORP, DRORP).
4. If operand D uses index F, only a 16-bit instruction is available.
5. If operand D is specified as KnY, KnM or KnS, only K4 (16-bit) or K8 (32-bit) is valid.
6. Valid range of operand n: 1 n 16 (16-bit), 1 n 32 (32-bit)
Program Example:
When X0 goes from OFF to ON, the 16 bits (4 bits as a group) in D10 will rotate to the right, as
shown in the figure below. The bit marked with will be sent to carry flag M1022..
011 10 101 0 0111 001
010111001111001 0 0
Upper bit Lower bit
Upper bit lower bit
*
X0
RORP D10 K4
Rotate to the right
16 bits
Carry
flag
Carry
flag
After one rotation
to the right
D10
D10
M1022M1022
M1022