5.1.7
Arithmetic operations
Arithmetic operations can only be re-
presented in statement list form.
They add or subtract the contents of
accumulators
1
and 2, using the cor-
responding load operations.
Example:
rzGq-=l
L,
IW1
+m
The two accumulators
1
and 2 can be
loaded by two load operations in keeping
L
1w2
m--=
with
the operands of these load operations.
-(IW2
m
Operation
+
F
-
F
The contents of the two accumulators
can then be added to each other or one
subtracted from the other.
-F
IW
1
-
IW
2
=
Result
Parameters
Function
Add
(accu.
1
+
accu.2)
Subtract
(accu. 2
-
accu.
1)
Note
:
If
the number range (-32768 to
+
32767) is exceeded,
the result of the operation
is undefined
(OV
=
"1")
Example
The right-hand byte of
data word 85 is to be
subtracted from the
number
+l27 and the re-
sult stored
in
the left-
hand byte of data word
85.
127
DR
85 74
Result
1
53
5.1.8
Other functions
The following operations can only be
represented in statement list form.
STL
L
KF +l27
L
DR
85
-F
T
DL
85
Explanation
The constant fixed-point number
+l27 is loaded into accumulator
1;
at the same time, the old con-
tents of accumulator 1 are shifted
into accumulator 2.
The right-hand byte of data word
85 is loaded into accumulator
1
and the f ixed-point number +l27
shifted into accumulator 2.
The contents of accumulator
1
are subtracted from those of ac-
cumulator
2
and the result stored
in accumulator
1.
The contents of accumulator
1
(result) are transferred to the
left-hand byte of data
,dord
85.
The STOP operation is used if, for example,
the
programmable controller has to enter
the Stop status in response to certain
critical plant states or on the occur-
rence of
a
hardware fault.
The
NOPs are used, for instance, for
keeping memory locations free or
over-
writing them.
The display construction statement de-
fines the subdivision of program sec-
tions into segments within a block.
Function
Stop
No operation
(all bits reset)
No operation
(all bits set)
Display
con-
struction state-
men
t
Operation
STP
NOP
0
N
OP
l
3LD
Parameter
0 to 255