
246
Example 1: Normal Data
The following example shows a four-digit subtraction with CY used to place ei-
ther #0000 or #0001 into R+1 to ensure that any carry is preserved.
CLC(41)
00001
SBB(51)
001
LR20
HR 21
MOV(21)
#0000
HR 22
MOV(21)
#0001
HR 22
TR 1
25504
25504
= R
= R+1
= R+1
Address
Instruction
Operands
00000
LD
00001
00001
OUT
TR
1
00002
CLC(41)
00003
SBB(51)
001
LR
20
HR
21
00004
AND NOT
25504
00005
MOV(21)
#
0000
HR
22
00006
LD
TR
1
00007
AND
25504
00008
MOV(21)
#
0001
HR
22
00009
NEG(––)
HR
21
HR
21
NEG(––)
HR21
HR 21
In the case below, the content of LR 20 (#7A03) and CY are subtracted from
IR 001 (#F8C5). The result is stored in HR 21 and the content of HR 22 (#0000)
indicates that the result is positive.
If the result had been negative, CY would have been set, #0001 would have
been placed in HR 22, and the result would have been converted to its 2’s com-
pliment.
Mi: IR 001
F
8
C
5
Su: LR 20
7
A
0
3
–
0
0
0
0
–
CY = 0
(from CLC(41))
R: HR 21
7
E
C
2
R+1: HR 22
0
0
0
0
Note
The status of the UF and OF flags can be ignored since they are relevant only in
the subtraction of signed binary data.
Binary Calculations
Section 5-20
Содержание SYSMAC C200HE
Страница 1: ...Cat No W303 E1 09 OPERATION MANUAL Programmable Controllers C200HX C200HG C200HE ...
Страница 2: ......
Страница 3: ...C200HX C200HG C200HE Programmable Controllers Operation Manual Revised August 2004 ...
Страница 6: ...vi ...
Страница 10: ......
Страница 12: ......
Страница 380: ......
Страница 410: ......
Страница 438: ......
Страница 464: ......
Страница 474: ......
Страница 522: ......
Страница 538: ......
Страница 552: ...534 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Страница 554: ......
Страница 560: ......
Страница 584: ......
Страница 585: ......
Страница 586: ...W303 E1 09 ...