
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
2 0 F 5
5 A
0
3
E
0
6
3
A
8
B
6
5 1
F 9 2 D
1
CY
R+1: D00100
8
CIO 0201
CIO 0200
−
Mi+1:
Mi:
Subtraction at 1
Su+1:
Su:
Summary of Contents for SYSMAC CS Series
Page 2: ......
Page 4: ...iv ...
Page 30: ...xxx ...
Page 186: ...146 List of Instructions by Function Code Section 2 4 ...
Page 1320: ...1280 Model Conversion Instructions Unit Ver 3 0 or Later Section 3 35 ...
Page 1390: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Page 1391: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits ...
Page 1392: ...1352 ASCII Code Table Appendix A ...
Page 1404: ...1364 Revision History ...