Right Rotation Of 32-Bit Data - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Right rotation of 32-bit data

DROR(P), DRCR(P)
High
Basic
Process
Redundant Universal
performance
DROR, DRCR
DRORP, DRCRP
(D): Head number of the devices to rotate (BIN 32 bits)
n:
Number of rotations (0 to 31) (BIN 16 bits)
Setting
Internal device
data
Bit
Word
(D)
n
Processing details
■DROR
• The 32-bit data of the device designated at (D), 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.
D
+1
b31
b30 b29 b28 b27
b18
b17
n-bit rotation
• When a bit device is designated for (D), 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.
• 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".
■DRCR
• Rotates 32-bit data of the device designated by (D), including the carry flag, n-bits to the right. The carry flag goes ON or
OFF depending on its status prior to the execution of the DRCR instruction.
+1
D
b31
b30 b29 b28 b27
b18
b17
n-bit rotation
• When a bit device is designated for (D), 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.
• 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".
LCPU
Command
Command
R, ZR
J\
Bit
D
b16
b15b14
b5 b4 b3
b2
D
b16
b15b14
b5 b4 b3
b2
indicates an instruction symbol of DROR/DRCR.
U\G
Word
Carry flag
(SM700)
b1 b0
Carry flag
(SM700)
b1 b0
D
n
P
D
n
Zn
Constant
Others
K, H
7 APPLICATION INSTRUCTIONS
7.2 Rotation Instructions
7
387

Advertisement

Table of Contents
loading

Table of Contents