Program instructions
7.14 Shift and rotate
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
361
The following figure shows bit shifting for negative and positive values of N.
A Shift Minus operation is indicated by a neg
a-
f length N. The input value of DATA
shifts into the most significant bit of the shift re
g-
ister, and shifts out of the least significant bit
location assigned by S_BIT. The data shifted out
is then placed in the overflow memory bit SM1.1.
A Shift Plus opera
tion is indicated by a positive
value of length N. The input value of DATA shifts
into the least significant bit location a
ssigned by
S_BIT and out of the most significant bit of the
Shift Register. The bit value shifted out is then
placed in the overflow
memory bit SM1.1.
The maximum length of the shift register a
s-
signed by N is 64 bits (positive or negative).
Example: SHRB instruction
LD I0.2
EU
SHRB I0.3, V100.0, +4