Omron CS1G/H-CPUxxH Instructions Manual page 282

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Comparison Instructions
Description
Area
Index Registers
Indirect addressing using
Index Registers
CPSL(115) compares the double signed binary data in S
S
and outputs the result to Arithmetic Flags (the Greater Than, Greater Than
2
or Equal, Equal, Less Than or Equal, Less Than, and Not Equal Flags) in the
Auxiliary Area.
Note CPSL(115) treats the data in S
ranges from 8000 0000 to 7FFF FFFF (
imal).
Arithmetic Flag Status
The following table shows the status of the Arithmetic Flags after execution of
CPSL(115). (A status of "---" indicates that the Flag may be ON or OFF.)
CPSL(115)Result
S
+1, S
> S
+1, S
1
1
2
S
+1, S
= S
+1, S
1
1
2
S
+1, S
< S
+1, S
1
1
2
Using CPSL(115) Results in the Program
When CPSL(115) 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 CPSL(115), 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
Using CPSL(115) Results in the Program
Do not program another instruction between CPSL(115) and the instruction
controlled by the Arithmetic Flag because the other instruction might change
S
1
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Signed binary
comparison
Arithmetic Flags
(>, >=, =, <=, <, <>)
and S
as double signed binary data which
1
2
2,147,483,648 to 2,147,483,647 dec-
>
> =
ON
ON
OFF
2
OFF
ON
ON
2
OFF
OFF
OFF
2
Correct Use of CPSL(115)
Arithmetic Flag
(Example: Equal Flag)
Section 3-7
S
2
+1, S
and S
1
1
S2+1
Flag status
=
< =
<
OFF
OFF
ON
OFF
ON
ON
1
CPSL
S1
S2
A
+1,
2
< >
ON
OFF
ON
+1, S
=
1
261

Advertisement

Table of Contents
loading

Table of Contents