![Omron CVM1D Скачать руководство пользователя страница 254](http://html1.mh-extra.com/html/omron/cvm1d/cvm1d_operation-manual_742532254.webp)
249
5-19
Binary Calculation Instructions
The Binary Calculation Instructions all perform arithmetic operations on binary
(hexadecimal) data. The CVM1D CPUs also support binary symbol math in-
structions. Refer to 5-20 Symbol Math Instructions for details.
The addition and subtraction instructions include CY in the calculation as well as
in the result. Be sure to clear CY if its previous status is not required in the cal-
culation, and to use the result placed in CY, if required, before it is changed by
the execution of any other instruction. STC(078) and CLC(079) can be used to
control CY. Refer to 5-18 BCD Calculation Instructions for details on STC(078)
and CLC(079).
5-19-1 BINARY ADD: ADB(080)
Variations
j
ADB(080)
(080)
ADB
Au
Ad
R
Operand Data Areas
Ladder Symbol
Au: Augend word
CIO, G, A, T, C, #, DM, DR, IR
R: Result word
CIO, G, A, DM, DR, IR
Ad: Addend word
CIO, G, A, T, C, #, DM, DR, IR
When the execution condition is OFF, ADB(080) is not executed. When the
execution condition is ON, ADB(080) adds the content of Au, Ad, and CY, and
places the result in R. CY will be set if the result is greater than FFFF.
Au + Ad + CY
CY R
Note An equivalent symbol math instruction (+C(402)) is also available, although
+C(402) has the additional feature of controlling the Overflow (A50009) and Un-
derflow (A50010) Flags.
Refer to page 101 for general precautions on operand data areas.
Flags
ER (A50003):
Content of
*
DM word is not BCD when set for BCD.
CY (A50004):
The result is greater than FFFF.
EQ (A50006):
The result is 0.
N (A50008):
Shows the status of bit 15 of R after execution.
Examples
The following example shows a four-digit addition with CY used to place either
0000 or 0001 into R+1 to ensure that any carry is preserved.
(079)
CLC
(080)
ADB
0010
D00100
1210
(030)
MOV
#0000
1211
0000
00
A500
04
= R
= R+1
00000
LD
000000
00001
OUT
TR0
00002
CLC(079)
00003
ADB(080)
0010
D00100
1210
00004
AND NOT
A50004
00005
MOV(030)
#0000
1211
00006
LD
TR0
00007
AND
A50004
00008
MOV(030)
#0001
1211
Address Instruction
Operands
(030)
MOV
#0001
1211
A500
04
TR0
= R+1
Description
Precautions
Binary Calculation Instructions
Section 5-19
Содержание CVM1D
Страница 462: ...SYSMAC CVM1D Duplex System Programmable Controllers Operation Manual Revised August 2001...
Страница 463: ...iv...
Страница 465: ...vi...