![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_742268336.webp)
297
Comparison Instructions
Section 3-7
Flags
Note
In CS1 and CJ1 CPU Units, these Flags are turned OFF.
In CS1-H, CJ1-H, CJ1M, and CS1D CPU Units, these Flags are left
unchanged.
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.
Examples
AND LESS THAN: AND<(310)
When CIO 000000 is ON in the following example, the contents of D00100
and D00200 are compared in as unsigned binary data. If the content of
D00100 is less than that of D00200, CIO 005000 is turned ON and execution
proceeds to the next line. If the content of D00100 is not less than that of
D00200, the remainder of the instruction line is skipped and execution moves
to the next instruction line.
AND SIGNED LESS THAN: AND<S(312)
When CIO 000001 is ON in the following example, the contents of D00110
and D00210 are compared as signed binary data. If the content of D00110 is
less than that of D00210, CIO 005001 is turned ON and execution proceeds
to the next line. If the content of D00110 is not less than that of D00210, the
Name
Label
Operation
Error Flag
ER
OFF or unchanged (See note.)
Greater 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.
Greater 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.
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.)
005000
005001
000000
000001
<
<S
34,580 > 14,876
S
2
: D00200
S
1
: D00100
8714
3A1C
Unsigned
LESS THAN
Comparison
Decimal: 34,580
Decimal: 14,876
(Will not proceed to next line.)
Summary of Contents for SYSMAC CS1D-CPU**
Page 3: ...iv...
Page 29: ...xxx...
Page 185: ...146 List of Instructions by Function Code Section 2 4...
Page 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Page 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Page 1391: ...1352 ASCII Code Table Appendix A...