Siemens CPU 948 Programming Manual page 129

Simatic s5 s5-155u
Table of Contents

Advertisement

Arithmetic operations
Table 3-19
Arithmetic operation ENT
Operation
Operand
ENT
Example
The following fraction must be calculated: (30 + 3 * 4) / 6 = 7
Contents of the ACCUs
before the sequence of
arithmetic operations
L KF +30
L KF +3
ENT
L KF +4
x F
+ F
L KF +6
:
F
CPU 948 Programming Guide
C79000-G8576-C848-04
Function
This causes a stack lift into ACCUs 3 and 4:
<ACCU 4> := <ACCU 3>
<ACCU 3> := <ACCU 2>
<ACCU 2> := <ACCU 2>
<ACCU 1> := <ACCU 1>
ACCUs 1 and 2 are not changed. The old contents
of ACCU 4 are lost.
ACCU 1
a
30
3
3
4
12
42
6
7
Supplementary Operations
ACCU 2
ACCU 3
b
c
a
c
30
c
30
30
3
30
30
c
c
c
c
42
c
c
ACCU 4
d
d
d
c
c
c
c
c
c
3 - 57

Advertisement

Table of Contents
loading

Table of Contents