beautypg.com

Hint, Precautions, Sample program – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 126: 2 instructions

background image

2 Instructions

2-90

CP1E CPU Unit Instructions Reference Manual(W483)

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.

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 com-
parison 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.

Sample program

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 100.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

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 100.01 is turned ON and exe-
cution 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.

True if C1

≤ C2

LD/AND/OR <=

LESS THAN OR EQUAL

315

LD/AND/OR<=L

DOUBLE LESS THAN OR EQUAL

316

LD/AND/OR <=S

SIGNED LESS THAN OR EQUAL

317

LD/AND/OR <=SL

DOUBLE SIGNED LESS THAN OR EQUAL

318

True if C1 > C2

LD/AND/OR >

GREATER THAN

320

LD/AND/OR >L

DOUBLE GREATER THAN

321

LD/AND/OR >S

SIGNED GREATER THAN

322

LD/AND/OR >SL

DOUBLE SIGNED GREATER THAN

323

True if C1

≥ C2

LD/AND/OR >=

GREATER THAN OR EQUAL

325

LD/AND/OR >=L

DOUBLE GREATER THAN OR EQUAL

326

LD/AND/OR >=S

SIGNED GREATER THAN OR EQUAL

327

LD/AND/OR>=SL

DBL SIGNED GREATER THAN OR EQUAL

328

Function

Mnemonic

Name

Code

<

D100

D200

0.00

100.00

100.01

D110

D210

0.01

34,580 > 14,876

S

2

: D200

S

1

: D100

8714

3A1C

Unsigned

LESS THAN

Comparison

Decimal: 34,580

Decimal: 14,876

(Will not proceed to next line.)

<

D100

D200

0.00

100.00

100.01

D110

D210

0.01

−30,956 < 14,876

S

2

: D210

S

1

: D110

8714

3A1C

Decimal:

−30,956

Decimal: 14,876

(Will proceed to next line.)

Signed
LESS THAN
Comparison

This manual is related to the following products: