265
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Comparison Instructions
3
CPS/CPSL
Flags
Note In CS1D CPU Units for Duplex Systems, CS1 CPU Units, and CJ1 CPU Units, these are turned OFF.
z
The following table shows the status of the Arithmetic Flags after execution of CPS(114).
*A status of “---” indicates that the Flag may be ON or OFF.
z
The following table shows the status of the Arithmetic Flags after execution of CPSL(115)
.
*A status of “---” indicates that the Flag may be ON or OFF.
Function
z CPS
CPS(114) compares the signed binary data in S
1
and S
2
and outputs the result to Arithmetic Flags (the
Greater Than, Greater Than or Equal, Equal, Less Than or Equal, Less Than, and Not Equal Flags) in
the Auxiliary Area.
z CPSL
CPSL(115) compares the double signed binary data in S
1
+1, S
1
and S
2
+1, S
2
and outputs the result to
Arithmetic Flags (the Greater Than, Greater Than or Equal, Equal, Less Than or Equal, Less Than, and
Not Equal Flags) in the Auxiliary Area.
Name Label
Operation
CPS CPSL
Error Flag ER Unchanged (See note.) OFF or unchanged (See note.)
Greater Than Flag > • ON if S
1
> S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
> S
2
+1, S
2
.
• OFF in all other cases.
Greater Than or Equal Flag > = • ON if S
1
≥ S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
≥ S
2
+1, S
2
.
• OFF in all other cases.
Equal Flag = • ON if S
1
= S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
= S
2
+1, S
2
.
• OFF in all other cases.
Not Equal Flag = • ON if S
1
≠ S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
≠ S
2
+1, S
2
.
• OFF in all other cases.
Less Than Flag < • ON if S
1
< S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
< S
2
+1, S
2
.
• OFF in all other cases.
Less Than or Equal Flag < = • ON if S
1
≤ S
2
.
• OFF in all other cases.
• ON if S
1
+1, S
1
≤ S
2
+1, S
2
.
• OFF in all other cases.
Negative Flag N Unchanged (See note.) OFF or unchanged (See note.)
CPS(114) Result
Flag status
> > = = < = < < >
S
1
> S
2
ON ON OFF OFF OFF ON
S
1
= S
2
OFFONONONOFFOFF
S
1
< S
2
OFF OFF OFF ON ON ON
CPSL(115) Result
Flag status
> > = = < = < < >
S
1
+1, S
1
> S
2
+1, S
2
ON ON OFF OFF OFF ON
S
1
+1, S
1
= S
2
+1, S
2
OFFONONONOFFOFF
S
1
+1, S
1
< S
2
+1, S
2
OFF OFF OFF ON ON ON
S1 S2
(>, >=, =, <=, <, <>)
Arithmetic Flags
Signed binary
comparison
S1S1+1 S2S2+2
(>, >=, =, <=, <, <>)
Signed binary
comparison
Arithmetic Flags