Omron SYSMAC CP Series Instruction & Reference Manual page 143

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

• Do not program another instruction between ZCP(088)/ZCPL(116) and the instruction controlled by
the Arithmetic Flag because the other instruction might change the status of the Arithmetic Flag.
Sample program
• When CIO 0.00 is ON in the following example, the 16-bit unsigned binary data in D0 is compared to
the range 0005 to 001F hex (5 to 31 decimal) and the result is output to the Arithmetic Flags.
CIO 20.00 is turned ON if 0005 hex ≤ content of D0 ≤ 001F hex.
CIO 20.01 is turned ON if the content of D0 > 001F hex.
CIO 20.02 is turned ON if the content of D0 < 0005 hex.
0.00
CP1E CPU Unit Instructions Reference Manual(W483)
Arithmetic Flag
(Example: Equal Flag)
In this case, the results of instruction B
might change the results of ZCP(088)/ZCPL(116).
ZCP
D0
CD
#0005
LL
#001F
UL
20.00
=
20.01
>
20.02
<
ZCPL
CD
LL
UL
Instruction B
A
LL
CD
UL
D0
0005Hex ≤
≤ 001FHex
D0
> 001FHex
D0
0005Hex >
2 Instructions
2
Arithmetic Flags
=
ON(1)
>
ON(1)
<
ON(1)
2-107

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents