Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 256

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Comparison Instructions
Description
Area
Indirect DM addresses in
binary
Indirect DM addresses in
BCD
Constants
Data Registers
Index Registers
Indirect addressing using
Index Registers
CMPL(060) compares the unsigned binary data in S
and outputs the result to Arithmetic Flags (the Greater Than, Greater Than or
Equal, Equal, Less Than or Equal, Less Than, and Not Equal Flags) in the
Auxiliary Area.
Unsigned binary
comparison
Arithmetic Flag Status
The following table shows the status of the Arithmetic Flags after execution of
CMPL(060). (A status of "---" indicates that the Flag may be ON or OFF.)
CMPL(060)Result
S
+1, S
> S
+1, S
ON
1
1
2
2
S
+1, S
= S
+1, S
OFF
1
1
2
2
S
+1, S
< S
+1, S
OFF
1
1
2
2
Using CMPL(060) Results in the Program
When CMPL(060) is executed, the result is reflected in the Arithmetic Flags.
Control the desired output or right-hand instruction with a branch from the
same input condition that controls CMPL(060), as shown in the following dia-
gram. Here, the Equals Flag and output A will be turned ON when S
S
+1, S
.
2
2
Correct Use of CMPL(060)
Arithmetic Flag
(Example: Equal Flag)
S
1
@ D0 to @ D32767
*D0 to *D32767
#00000000 to #FFFFFFFF (binary)
&0 to &4294967295 (unsigned decimal)
---
IR0 to IR15
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
S2+1
Arithmetic Flags
(>, >=, =, <=, <, <>)
Flag status
>
> =
=
ON
OFF
ON
ON
OFF
OFF
CMPL
S1
S2
A
Section 3-6
S
2
+1, S
and S
+1, S
1
1
2
< =
<
< >
OFF
OFF
ON
ON
OFF
OFF
ON
ON
ON
+1, S
1
223
2
=
1

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CP - PROGRAMMING MANUAL 05-2007 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents