7.2.3 Right Rotation Of 32-Bit Data - Mitsubishi MELSEC-Q Series Programming Manual

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

Advertisement

Program Example
(1) In the following program, the data of Var_D0 are rotated, not including the carry flag, 4 bits to
the right, when X0C turns ON.
[Structured ladder]
[ST]
DRORP(X0C,4,Var_D0);
[Operation]
b31
b28 b27 b24 b23 b20 b19
Var_D0 0
0
0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
b31
b28 b27 b24 b23 b20b19
Var_D0 1
1
1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Contents of b3 to b0
before execution
(2) In the following program, the data of Var_D0 are rotated, including the carry flag, 4 bits to the
right, when X0C turns ON.
[Structured ladder]
[ST]
DRCRP(X0C,4,Var_D0);
[Operation]
Var_D0 0
Var_D0 1
Contents of b2 to b0
before execution
b16
b15
b12b11
b16
b15
b12b11
Contents of b31 to b4
before execution
b31
b28b27 b24 b23 b20b19
0
0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
b31
b28b27 b24 b23 b20b19
1
1
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Content of carry flag
SM700 before execution
: ON/OFF status of the carry flag depends on its status before the execution of DRCR instruction.
Carry flag
b8 b7
b4 b3
b0
Carry flag
(SM700)
b8 b7
b4 b3
b0
Content of b3
before execution
b16
b15
b12b11
b8 b7
b4 b3
b16
b15
b12b11
b8 b7
b4 b3
Before execution
7.2 Rotation Instructions

7.2.3 Right rotation of 32-bit data

DROR, DRCR
(SM700)
0
1
Carry flag
(SM700)
b0
Carry flag
b0
(SM700)
1
Content of b3
before execution
7-37
7

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qcpu

Table of Contents