3. Instructions
256
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Hint
• Unlike instructions such as CMP(020) and CMPL(060), the result of an input comparison instruction
is reflected directly as an execution condition, so it is not necessary to access the result of the
comparison through an Arithmetic Flag and the program is simpler and faster.
Precautions
• Input comparison instructions cannot be used as right-hand instructions, i.e., another instruction
must be used between them and the right bus bar.
Example Programming
AND LESS THAN: AND<(310)
When CIO 0.00 is ON in the following example, the contents of D100 and D200 are compared in as
unsigned binary data. If the content of D100 is less than that of D200, CIO 50.00 is turned ON and
execution proceeds to the next line. If the content of D100 is not less than that of D200, the remainder
of the instruction line is skipped and execution moves to the next instruction line.
i
AND SIGNED LESS THAN: AND<S(312)
When CIO 0.01 is ON in the following example, the contents of D110 and D210 are compared as
signed binary data. If the content of D110 is less than that of D210, CIO 50.01 is turned ON and
execution proceeds to the next line. If the content of D110 is not less than that of D210, the remainder
of the instruction line is skipped and execution moves to the next instruction line.
325 LD>= LOAD GREATER THAN OR EQUAL True if
C1 ≥ C2
AND>= AND GREATER THAN OR EQUAL
OR>= OR GREATER THAN OR EQUAL
326 LD>=L LOAD DOUBLE GREATER THAN OR EQUAL
AND>=L AND DOUBLE GREATER THAN OR EQUAL
OR>=L OR DOUBLE GREATER THAN OR EQUAL
327 LD>=S LOAD SIGNED GREATER THAN OR EQUAL
AND>=S AND SIGNED GREATER THAN OR EQUAL
OR>=S OR SIGNED GREATER THAN OR EQUAL
328 LD>=SL LOAD DBL SIGNED GREATER THAN OR EQUAL
AND>=SL AND DBL SIGNED GREATER THAN OR EQUAL
OR>=SL OR DBL SIGNED GREATER THAN OR EQUAL
Code Mnemonic Name Function
50.00
50.01
0.00
0.01
<
<S
34,580 > 14,876
S
2
: D200S
1
: D100
8714 3A1C
D100
D200
D110
D210
Unsigned
LESS THAN
Comparison
Decimal: 34,580 Decimal: 14,876
(Will not proceed to next line.)
8714
S
1
: D110
-30,956
3A1C
S
2
: D210
14,876
−30,956 < 14,876
D100
D200
D110
D210
50.00
50.01
0.00
0.01
Decimal: Decimal:
Signed
LESS THAN
Comparison
(Will proceed to next line.)