3. Instructions
Precautions
• When ZCPS(117)/ZCPSL(118) 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
ZCPS(117)/ZCPSL(118), as shown in the following diagram.
• Do not program another instruction between ZCPS(117)/ZCPSL(118) and the instruction controlled
by the Arithmetic Flag because the other instruction might change the status of the Arithmetic Flag.
Example Programming
• When CIO 0.00 is ON in the following example, the 16-bit signed binary data in D0 is compared to the
range FFF6 to 0064 hex ( 10 to 100 decimal) and the result is output to the Arithmetic Flags.
• CIO 20.00 is turned ON if 10 decimal
content of D0 > 100 decimal. CIO 20.02 is turned ON if the content of D0 < 10 decimal.
0.00
282
Arithmetic Flag
Example: P_EQ
If LL
CD
and A turns ON.
Arithmetic Flag
Example: P_EQ
In this case, the results of instruction B
might change the results of ZCPS(117)/ZCPSL(118).
content of D0
ZCPS
D0
CD
10
LL
+100
UL
20.00
P_EQ
20.01
P_GT
20.02
P_LT
ZCPS
CD
LL
UL
A
UL, P_EQ turns ON
ZCPSL
CD
LL
UL
Instruction
B
A
100 decimal. CIO 20.01 is turned ON if the
LL
CD
UL
D0
≤
≤
10
100
D0
>
100
D0
10
>
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 and is the answer not in the manual?