Condition Code Generation - Siemens SIMATIC S5-95F Manual

Table of Contents

Advertisement

STEP 5 Operations
8.4

Condition Code Generation

The processor of the programmable controller has the following three condition codes:
CC 0
CC 1
OV
(overflow)
The following operations affect the condition codes.
Comparison operations
Arithmetic operations
Shift operations
Some conversion operations
The state of the condition codes represents a condition for the various jump operations.
Condition Code Generation for Comparison Operations
Execution of comparison operations sets condition codes CC 0 and CC 1 (see Table 8-30). The
overflow condition code is not affected.
comparison is satisfied, the RLO is 1. This allows you to use the "JC" conditional jump operation
after a comparison operation.
Table 8-30. Condition Code Settings for Comparison Operations
Contents of ACCU 2 as
Compared to Contents
of ACCU 1
Equal to
Less than
Greater than
Condition Code Generation for Arithmetic Operations
Execution of arithmetic operations sets all condition codes according to the result of the arithmetic
operation (see Table 8-31).
Table 8-31. Condition Code Settings for Fixed-Point Arithmetic Operations
Result after
Arithmetic Operation
is Executed
< - 32768
- 32768 to - 1
0
+1 to +32767
> +32767
(-) 65536*
*
This number is the result of the calculation -32768 - 32768
8-68
Comparison operations do affect the RLO.
Condition Codes
CC 1
CC 0
0
0
0
1
1
0
Condition Codes
CC 1
CC 0
1
0
0
1
0
0
1
0
0
1
0
0
Possible
Jump Operations
OV
JZ
JN, JM
JN, JP
Possible
Jump Operations
OV
1
JN, JP, JO
0
JN, JM
0
JZ
0
JN, JP
1
JN, JM, JO
1
JZ, JO
EWA 4NEB 812 6210-02
S5-95F
When a

Advertisement

Table of Contents
loading

Table of Contents