2-89

2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Comparison Instructions
2
=, <>, <, <=, >, >=
Functioni

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.

Less Than Flag P_LT ON if S1 < S2 with one-word data.
OFF in all other cases.
ON if S1+1, S1 < S2+1, S2 with double-length data.
OFF in all other cases.
Less Than or Equal Flag P_LE ON if S1 S2 with one-word data.
OFF in all other cases.
ON if S1+1, S1 S2+1, S2 with double-length data.
OFF in all other cases.
Negative Flag P_N OFF or unchanged OFF or unchanged
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
Function Mnemonic Name Code
True if C1 = C2 LD/AND/OR = EQUAL 300
LD/AND/OR =L DOUBLE EQUAL 301
LD/AND/OR =S SIGNED EQUAL 302
LD/AND/OR =SL DOUBLE SIGNED EQUAL 303
True if C1 C2 LD/AND/OR <> NOT EQUAL 305
LD/AND/OR <>L DOUBLE NOT EQUAL 306
LD/AND/OR <>S SIGNED NOT EQUAL 307
LD/AND/OR <>SL DOUBLE SIGNED NOT EQUAL 308
True if C1 < C2 LD/AND/OR < LESS THAN 310
LD/AND/OR <L DOUBLE LESS THAN 311
LD/AND/OR<S SIGNED LESS THAN 312
LD/AND/OR <SL DOUBLE SIGNED LESS THAN 313
Name Label Operation
Data length: one-word Data length: double length
<
<
S1
S2
S1
S2
S1
S2
<
LD connection
AND connection
OR connection
ON execution condition when
comparison result is true.
ON execution condition whe
n
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.