3. Instructions
254
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Note In CS1D CPU Units for Duplex Systems, CS1 CPU Units, and CJ1 CPU Units, these are turned OFF.
In CJ2, CS1-H, CJ1-H, CJ1M, and CS1D CPU Units, these Flags are left unchanged.
Functioni
z Options
The input comparison instructions can compare signed or unsigned data and they can compare one-
word or double values. If no options are specified, the comparison will be for one-word unsigned data.
With the three input types and two options, there are 72 different input comparison instructions.
Unsigned input comparison instructions (i.e., instructions without the S option) can handle unsigned
binary or BCD data. Signed input comparison instructions (i.e., instructions with the S option) handle
signed binary data.
Equal Flag = • ON if S
1
= S
2
with one-word data.
• ON if S
1
+1, S
1
= S
2
+1, S
2
with double-length data.
• OFF in all other cases.
Not Equal Flag < > • ON if S
1
≠ S
2
with one-word data.
• ON if S
1
+1, S
1
≠ S
2
+1, S
2
with double-length data.
• OFF in all other cases.
Less Than Flag < • ON if S
1
< S
2
with one-word data.
• ON if S
1
+1, S
1
< S
2
+1, S
2
with double-length data.
• OFF in all other cases.
Less Than or Equal Flag < = • ON if S
1
≤ S
2
with one-word data.
• ON if S
1
+1, S
1
≤ S
2
+1, S
2
with double-length data.
• OFF in all other cases.
Negative Flag N OFF or unchanged (See note.)
Symbol Option (data format) Option (data length)
= (Equal)
< > (Not equal)
< (Less than)
<= (Less than or equal)
> (Greater than)
>= (Greater than or equal)
None: Unsigned data
S: Signed data
None: One-word data
L: Double-length data
Name Label Operation
<
<
S1
S2
S1
S2
S1
S2
<
LD connection
AND connection
OR connection
ON execution condition when
comparison result is true.
ON execution condition when
comparison result is true.
ON execution condition when
comparison result is true.
The input comparison instruction compares S1
and S2 as signed or unsigned values and creates
an ON execution condition when the comparison
condition is true.
The input comparison instructions are treated just
like the LD, AND, and OR instructions to control
the execution of subsequent instructions.
Input type Operation
LD The instruction can be connected directly to the
left bus bar.
AND The instruction cannot be connected directly to the
left bus bar.
OR The instruction can be connected directly to the
left bus bar.