Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 276

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
Flags
Arithmetic Flag Status
The following table shows the status of the Arithmetic Flags after execution of
ZCP(088).
ZCP(088)Result
CD > UL
ON
CD = UL
OFF
LL < CD < UL
CD = LL
CD < LL
Using ZCP(088) Results in the Program
When ZCP(088) is executed, the result is reflected in the Arithmetic Flags.
Control the desired output or right-hand instruction with a branch from the
same input condition that controls ZCP(088), as shown in the following dia-
gram. In this case, the Equals Flag and output A will be turned ON when
LL
CD
UL.
Correct Use of ZCP(088)
Arithmetic Flag
(Example: Equal Flag)
Do not program another instruction between ZCP(088) and the instruction
controlled by the Arithmetic Flag because the other instruction might change
the status of the Arithmetic Flag. In this case, the results of instruction B might
change the results of ZCP(088).
Incorrect Use of ZCP(088)
Name
Error Flag
Greater Than Flag
Greater Than or Equal Flag
Flag status
>
=
<
OFF
OFF
ON
OFF
ON
ZCP
CD
LL
UL
A
ZCPL
CD
LL
UL
Instruction
B
A
Arithmetic Flag
(Example: Equal Flag)
Label
ER
ON if LL > UL.
>
ON if CD > UL.
OFF in all other cases.
> =
Left unchanged.
Section 3-6
Operation
243

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents