EasyManua.ls Logo

Omron SYSMAC CJ - REFERENCE MANUAL 08-2008

Omron SYSMAC CJ - REFERENCE MANUAL 08-2008
1405 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
445
Symbol Math Instructions Section 3-11
Program Example 20F55A10 – B8A360E3 = –97AE06D3.
In this example, the eight-digit binary value in CIO 0121 and CIO 0120 is sub-
tracted from the value in CIO 0201 and CIO 0200, and the result is output in
eight-digit binary to D00101 and D00100. If the result is negative, the instruc-
tion at (2) will be executed, and the actual result will then be output to D00101
and D00100.
The Carry Flag (CY) is ON, so the result is subtracted from 0000 0000 to
obtain the actual number.
1
+1
)
65535
1
)
)
3
1
)
65533
65535
)
)
Note 1.
2.
3.
4.
Example 1
Signed data Unsigned data
Example 2
Signed data Unsigned data
FFFF Hex
0001 Hex
FFFE Hex
2 Note 1
65534 Note 2
FFFD Hex
FFFF Hex
FFFE Hex
2 Note 3 65534 Note 4
Carry Flag OFF
Negative Flag ON
Carry Flag OFF
Negative Flag ON
Since the Negative Flag is ON, the result (FFFE hex) is a
negative value (2's complement) and is thus
2.
Since the Carry Flag is OFF, the result (FFFE hex) is an
unsigned positive value of 65534.
Since the Negative Flag is ON, the result (FFFE hex) is a
negative value (2's complement) and is thus
2.
Since the Carry Flag is ON, the result (FFFE hex) is a
negative value (2's complement) and becomes
2 when
converted to a true value.
L
0200
0120
D00100
000000
(1)
CY
CY
(2)
RSET
002100
SET
002100
L
#00000000
D00100
D00100
""display
1
R+1: D00101
CIO 0121 CIO 0120
20F5 5A 0
3E063A8B
651
F
92
D1
CY
R+1: D00100
8
CIO 0201 CIO 0200
Mi+1: Mi:
Subtraction at 1
Su+1: Su:

Table of Contents

Related product manuals