Shift Operations - Siemens SIMATIC S5 Manual

Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

S5-115F Manual
3.2.5

Shift Operations

Shift operations shift a bit pattern in ACCUM 1. The contents of ACCUM 2 are not affected.
Shifting multiplies or divides the contents of ACCUM 1 by powers of two. Table 3-15 provides an
overview of the shift operations. Examples follow the table.
Operation
Operand
SLW
SRW
Processing a shift operation
Execution of shift operations is unconditional. The RLO is not affected. However, shift operations
set condition codes.
Consequently, the status of the last bit that is shifted out can be scanned with jump functions.
The shift statement parameter indicates the number of bit positions by which the contents of
ACCUM 1 are to be shifted to the left (SLW) or to the right (SRW). Bit positions vacated during
shifting are assigned zeros.
The contents of the bits that are shifted out of ACCUM 1 are lost.
A shift operation with parameter "0" is handled like a "NOP" operation. The central processor
processes the next STEP 5 statement with no further reaction.
Before executing a shift operation, load the operand to be processed into ACCUM 1. The altered
operand is available there for further processing.
EWA 4NEB 811 6149-02
Table 3-15. Overview of Shift Operations
Shift to the left.
The bit pattern in ACCUM 1 is shifted to the left.
Shift to the right.
The bit pattern in ACCUM 1 is shifted to the right.
Parameter
0 to 15
Meaning
STEP 5 Operations
3-49

Advertisement

Table of Contents
loading

This manual is also suitable for:

S5-115f

Table of Contents