Comparison Instructions - Omron CP1E CPU UNIT SOFTWARE User Manual

Cp1e cpu unit software
Table of Contents

Advertisement

Appendices
A-1-5

Comparison Instructions

Instruction
Mnemonic
Symbol Com-
LD, AND, OR +
parison
=, <>, <, <=, >,
(Unsigned)
>=
Symbol Com-
LD, AND, OR +
parison (Dou-
=, <>, <, <=, >,
ble-word,
>= + L
unsigned)
Symbol Com-
LD, AND, OR +
parison
=, <>, <, <=, >,
(Signed)
>= +S
Symbol Com-
LD, AND, OR +
parison (Dou-
=, <>, <, <=, >,
ble-word,
>= +SL
signed)
Time Compari-
LD, AND, OR +
son
= DT, <> DT,
< DT, <= DT,
> DT, >= DT
UNSIGNED
CMP
COMPARE
A-10
Variations
Symbol/Operand
---
LD
Symbol and option
---
S
1
S
2
---
AND
Symbol and option
---
S
1
S
2
OR
Symbol and option
S
1
S
2
One-word
S1: Comparison data 1
S2: Comparison data 2
Double length
S1: 1st word of comparison data 1
S2: 1st word of comparison data 2
---
LD (LOAD):
Symbol
C
S1
S2
AND:
Symbol
C
S1
S2
OR:
Symbol
C
S1
S2
C: Control word
S1: 1st word of present time
S2: 1st word of comparison time
!
CMP(020)
S
1
S
2
S1: Comparison data 1
S2: Comparison data 2
Function
Input comparison instructions compare two values (constants
and/or the contents of specified words) and create an ON execu-
tion condition when the comparison condition is true.
Input comparison instructions are available to compare signed or
unsigned data of one-word or double length data.
LD
ON execution condition when
comparison result is true.
<
AND
<
OR
<
ON execution condition when
comparison result is true.
Time comparison instructions compare two BCD time values and
create an ON execution condition when the comparison condition
is true.
There are three types of time comparison instructions, LD (LOAD),
AND, and OR. Time values (year, month, day, hour, minute, and
second) can be masked/unmasked in the comparison so it is easy
to create calendar timer functions.
C: Control Word
Bits 00 to 05 of C specify whether or not the time data will be
masked for the comparison. Bits 00 to 05 mask the seconds,
minutes, hours, day, month, and year, respectively. If all 6 val-
ues are masked, the instruction will not be executed, the execu-
tion condition will be OFF, and the Error Flag will be turned ON.
15
8 7 6 5 4 3 2 1 0
C
0 0 0 0 0 0 0 0 0 0
Compares two unsigned binary values (constants and/or the con-
tents of specified words) and outputs the result to the Arithmetic
Flags in the Auxiliary Area.
Unsigned binary
comparison
Arithmetic Flags
(>, >=, =, <=, <, <>)
CP1E CPU Unit Software User's Manual(W480)
ON execution
condition when
comparison result
is true.
Masks seconds data when ON.
Masks minutes data when ON.
Masks hours data when ON.
Masks day data when ON.
Masks month data when ON.
Masks year data when ON.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CP1E CPU UNIT SOFTWARE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF