Binary Calculation Instructions; Binary Add: Adb(080) - Omron CVM1D Operation Manual

Hide thumbs Also See for CVM1D:
Table of Contents

Advertisement

Binary Calculation Instructions

5-19

Binary Calculation Instructions

5-19-1 BINARY ADD: ADB(080)

Ladder Symbol
(080)
ADB
Au
Variations
j ADB(080)
Description
Precautions
Flags
Examples
0000
TR0
00
A500
04
A500
04
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).
Ad
R
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
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.
Content of *DM word is not BCD when set for BCD.
ER (A50003):
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.
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.
(080)
ADB
0010
D00100
(030)
MOV
#0000
(030)
MOV
#0001
Operand Data Areas
Au: Augend word
CIO, G, A, T, C, #, DM, DR, IR
Ad: Addend word
CIO, G, A, T, C, #, DM, DR, IR
R: Result word
CIO, G, A, DM, DR, IR
CY
(079)
CLC
= R
1210
1211
= R+1
1211
= R+1
Section 5-19
R
Address Instruction
Operands
00000
LD
000000
00001
OUT
00002
CLC(079)
00003
ADB(080)
D00100
00004
AND NOT
A50004
00005
MOV(030)
#0000
00006
LD
00007
AND
A50004
00008
MOV(030)
#0001
TR0
0010
1210
1211
TR0
1211
249

Advertisement

Table of Contents
loading

Table of Contents