3. Instructions
Flags
Name
Error Flag
Greater Than Flag
Greater Than or Equal Flag
Equal Flag
Not Equal Flag
Less Than Flag
Less Than or Equal Flag
Negative Flag
Note In CS1D CPU Units for Duplex Systems, CS1 CPU Units, and CJ1 CPU Units, these are turned OFF.
The following table shows the status of the Arithmetic Flags after execution of CMP(020).
CMP(020) Result
S
> S
1
2
S
= S
1
2
S
< S
1
2
*A status of "---" indicates that the Flag may be ON or OFF.
The following table shows the status of the Arithmetic Flags after execution of CMPL(060).
CMPL(060) Result
S
+1, S
> S
+1, S
1
1
2
2
S
+1, S
= S
+1, S
1
1
2
2
S
+1, S
< S
+1, S
1
1
2
2
*A status of "---" indicates that the Flag may be ON or OFF.
Function
CMP
CMP(020) compares the unsigned binary data in S
(the Greater Than, Greater Than or Equal, Equal, Less Than or Equal, Less Than, and Not Equal
Flags) in the Auxiliary Area.
CMPL
CMPL(060) compares the unsigned binary data in S
Arithmetic Flags (the Greater Than, Greater Than or Equal, Equal, Less Than or Equal, Less Than, and
Not Equal Flags) in the Auxiliary Area.
258
CX-Programmer
label
ER
Unchanged (See note.)
>
• ON if S
> S
1
• OFF in all other cases.
> =
• ON if S
S
1
• OFF in all other cases.
=
• ON if S
= S
1
• OFF in all other cases.
=
• ON if S
S
1
• OFF in all other cases.
<
• ON if S
< S
1
• OFF in all other cases.
< =
• ON if S
S
1
• OFF in all other cases.
N
Unchanged (See note.)
>
> =
ON
ON
OFF
OFF
ON
ON
OFF
OFF
OFF
Unsigned binary
comparison
S1
>
> =
ON
ON
OFF
OFF
ON
ON
OFF
OFF
OFF
Unsigned binary
comparison
S1+1
S1
Operation
CMP
Unchanged (See note.)
.
• ON if S
2
• OFF in all other cases.
.
• ON if S
2
• OFF in all other cases.
.
• ON if S
2
• OFF in all other cases.
.
• ON if S
2
• OFF in all other cases.
.
• ON if S
2
• OFF in all other cases.
.
• ON if S
2
• OFF in all other cases.
Unchanged (See note.)
Flag status
=
< =
<
OFF
OFF
ON
OFF
ON
ON
S2
Arithmetic Flags
(>, >=, =, <=, <, <>)
Flag status
=
< =
<
OFF
OFF
ON
OFF
ON
ON
S2+1
S2
Arithmetic Flags
(>, >=, =, <=, <, <>)
and S
and outputs the result to Arithmetic Flags
1
2
+1, S
and S
1
1
CS/CJ/NSJ Series Instructions Reference Manual (W474)
CMPL
+1, S
> S
+1, S
.
1
1
2
2
+1, S
S
+1, S
.
1
1
2
2
+1, S
= S
+1, S
.
1
1
2
2
+1, S
S
+1, S
.
1
1
2
2
+1, S
< S
+1, S
.
1
1
2
2
+1, S
S
+1, S
.
1
1
2
2
< >
ON
OFF
ON
< >
ON
OFF
ON
+1, S
and outputs the result to
2
2
Need help?
Do you have a question about the CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 and is the answer not in the manual?
Questions and answers