DVP - ES2/EX2/SS2/SA2/SX2/SE Operation Manual - Programming

API

Mnemonic

Operands

Function

Controllers

31

D

ROL

 

P

 

 

 

 

Rotate Left

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

 

 

 

 

SE

 

Type

Bit Devices

 

 

 

Word devices

 

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F

ROL, ROLP: 5 steps

 

 

D

 

 

 

 

*

*

 

*

*

*

*

*

*

*

*

DROL, DROLP: 9 steps

 

n

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

16-bit

 

 

 

32-bit

 

 

 

 

 

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2 ES2/EX2

SS2

SA2

SX2

 

 

 

 

 

 

SE

SE

SE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operands:

D: Device to be rotated n: Number of bits to be rotated in 1 rotation

Explanation:

1.This instruction rotates bit status of the device D to the left for n bits

2.The status of the last bit rotated (marked with ) is copied to the carry flag M1022.

3.This instruction is generally used in pulse execution mode (ROLP, DROLP).

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, all the 16 bits (4 bits as a group) in D10 will rotate to the left, as shown in the figure below. The bit marked with will be sent to carry flag M1022.

 

X0

 

 

 

 

ROLP

D10

 

 

 

 

K4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Rotate to the left

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Upper bit

 

 

 

 

 

 

 

 

Lower bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M1022

 

 

 

 

1

1

1

1 1

1 1

1

0

0 0

0

0

0

0

0

D10

 

 

 

 

Carry

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

flag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

16 bits

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After one rotation

 

 

 

 

 

 

 

 

 

 

Upper bit

 

 

 

 

 

to the left

 

Lower bit

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

M1022

1

 

 

1

1 1

1 0

0

0

0

0

0 0

0

1

1

1

1

D10

Carry

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

flag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 - 92

Page 208
Image 208
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Rol, Explanation