Math Instructions - Automationdirect.com DirectLOGIC DL205 Series User Manual

Table of Contents

Advertisement

Chapter 5: Standard RLL Instructions - Math

Math Instructions

1
Add (ADD)
2
Add is a 16-bit instruction that adds a BCD value in the
230
accumulator with a BCD value in a V-memory location
240
(Aaaa). (You cannot use a constant (K) as the BCD value in
3
250-1
the box.) The result resides in the accumulator.
260
4
DS
Used
5
HPP Used
V-memory
Pointer
6
Discrete Bit Flags
SP63
7
SP66
SP67
8
SP70
SP75
9
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
10
In the following example, when X1 is on, the value in V2000 will be loaded into the
accumulator using the Load instruction. The value in the lower 16 bits of the accumulator are
added to the value in V2006 using the Add instruction. The value in the accumulator is
11
copied to V2010 using the Out instruction.
12
13
14
A
B
C
D
5–88
DL205 User Manual, 4th Edition, Rev. B
Operand Data Type
A
V
P
On when the result of the instruction causes the value in the accumulator to be zero
On when the 16 bit addition instruction results in a carry
On when the 32 bit addition instruction results in a carry
On anytime the value in the accumulator is negative
On when a BCD instruction is executed and a NON-BCD number is encountered
DirectSOFT
X1
LD
V2000
Load the value in V2000 into
the lower 16 bits of the
accumulator
ADD
V2006
Add the value in the lower
16 bits of the accumulator
with the value in V2006
OUT
V2010
Copy the value in the lower
16 bits of the accumulator to
V2010
Handheld Programmer Keystrokes
$
B
ENT
STR
1
L
D
SHFT
ANDST
3
A
D
D
SHFT
0
3
GX
V
SHFT
OUT
AND
DL230 Range DL240 Range DL250-1 Range DL260 Range
aaa
aaa
All
All
See memory map
See memory map
All V-memory.
-
See memory map
Description
The unused accumulator
bits are set to zero
0
0
+
C
A
A
A
2
0
0
0
C
A
A
3
2
0
0
C
A
B
A
2
0
1
0
ADD
A aaa
aaa
All
See memory map
All V-memory.
See memory map
V2000
4
9
3
5
0
0
4
9
3
5
(Accumulator)
(V2006)
2
5
0
0
Acc.
7
4
3
5
7
4
3
5
V2010
ENT
G
ENT
6
ENT
aaa
All
See memory map
All V-memory.
See memory map

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF