Shift Right, Shift 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 Shift Right function shifts the value specified by the variable IN to the right for the number of locations specified by N. The result is placed into the variable specified by OUT. Each bit is filled with a zero when it is shifted right.

The Shift Left function shifts the value specified by the variable IN to the left for the number of locations specified by N. The result is placed into the variable specified by OUT. Each bit is filled with a zero when it is shifted left.

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)