3. Instructions
• 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
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
274
Arithmetic Flag
(Example: Equal Flag)
In this case, the results of instruction B
might change the results of ZCP(088)/ZCPL(116).
content of D0
ZCP
D0
CD
0005Hex
#0005
LL
#001F
UL
20.00
0005Hex
=
20.01
>
20.02
<
ZCPL
CD
LL
UL
Instruction
B
A
001F hex.
LL
CD
UL
D0
≤
≤
001FHex
D0
>
001FHex
D0
>
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Arithmetic Flags
=
ON(1)
>
ON(1)
<
ON(1)
Need help?
Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?