Rotate Right, Rotate Left Shift/Rotate

Inputs/Outputs Operands Data Types
IN VB, IB, QB, MB, SB, SMB, LB, VW, IW, QW, MW, SW, SMW, LW, T, C, AIW, VD, ID, QD, MD, SD, SMD, LD, HC, AC, Constant, *VD, *LD, *AC BYTE, WORD, DWORD
N VB, IB, QB, MB, SB, SMB, LB, AC, Constant, *VD, *AC, *LD BYTE
OUT VB, IB, QB, MB, SB, SMB, LB, VW, IW, QW, MW, SW, SMW, LW, T, C, VD, ID, QD, MD, SD, SMD, LD, AC, *VD, *LD, *AC BYTE, WORD, DWORD

Memory Ranges ENO Errors Instruction Support for S7-200 CPUs SIMATIC/International Mnemonics
The Rotate Right and Rotate Left functions rotate the input value (IN) right or left by the shift count (N), and load the result in the output (OUT).

The rotation is circular. In ROR, bit zero is rotated to the most significant bit. In ROL, the most significant bit is rotated to bit zero.

Note that the sign bit is shifted when you are using signed data types.

Error Conditions that Set ENO = 0:

0006 (indirect address), SM4.3 (run-time)