Rotation Instruction; Ror, Rorp, Rcr, Rcrpright Rotation Of 16-Bit Data - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

ROR, RORP, RCR, RCRP
7.2

Rotation instruction

7.2.1

ROR, RORP, RCR, RCRPRight rotation of 16-bit data

7.2.1
ROR, RORP, RCR, RCRP
ROR, RCR
RORP, RCRP
: Head number of the devices to rotate (BIN 16 bits)
D
n
: Number of rotations (0 to 15) (BIN 16 bits)
Internal Devices
Setting
Data
Bit
D
n
Function
ROR
(1) Rotates 16-bit data of the device designated by
The carry flag is ON or OFF depending on the status prior to the execution of the ROR instruction.
b15 b14 b13 b12 b11 b10 b9
D
b15 b14 b13 b12 b11 b10 b9
D
Value of b0
b15 b14 b13 b12 b11 b10 b9
D
Value of b0
b15 b14 b13 b12 b11 b10 b9
D
Value of b(n-1)
(2) When a bit device is designated for
The number of bits by which a rotation is carried out is the remainder of n/(specified number of bits).
For example, when n
rotated 3 bits.
(3) Specify any of 0 to 15 as n.
If the value specified as n is 16 or greater, the remainder of n / 16 is used for rotation.
For example, when n
330
Command
Command
R, ZR
Word
Bit
, not including the carry flag, n-bits to the right.
D
b8
b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
0
0
0
0
0
0
b8
b7 b6 b5 b4 b3 b2 b1 b0
1
0
0
0
0
0
0
0
0
b8
b7 b6 b5 b4 b3 b2 b1 b0
0
1
0
0
0
0
0
0
0
b8
b7 b6 b5 b4 b3 b2 b1 b0
, a rotation is performed within the device range specified by digit specification.
D
15 and (specified number of bits)
18, the contents are rotated two bits to the right since the remainder of 18 / 16
High
Basic
performance
indicates an instruction symbol of ROR/RCR.
P
J
\
U
\G
Word
0
0
0
0
1
0
1
Right rotation (1 bit)
0
0
0
0
0
1
0
Right rotation (1 bit)
1
0
0
0
0
0
0
Right rotation (n bits)
12 bits, the remainder of 15/12
Process
LCPU
Redundant Universal
D
n
D
n
Constants
Zn
Other
K, H
––
Carry flag
(SM700)
0
Carry flag
(SM700)
1
Value of b0
Carry flag
(SM700)
0
Value of b0
Carry flag
(SM700)
Value of b(n-1)
1 is "3", and the data is
1 is "2".
––
––

Advertisement

Table of Contents
loading

Table of Contents