EasyManua.ls Logo

AutomationDirect DL205 - Page 325

Default Icon
598 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DL205 User Manual, 4th Edition, Rev. D
5-101
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Add Binary (ADDB)
The Add Binary instruction adds a 16-bit number (Aaaa)
to the value stored in the accumulator. The number in the
accumulator can be up to 32 bits long. The source of the
16-bit operand can be a constant or a data value located in
V-memory. Add Binary performs the addition operation on the
full binary representation of the operands, which distinguishes
it from the Add instruction (see page 5-88), which treats the operands as BCD numbers.
Although the addition operation is performed on the underlying binary values, the native
display format is hexadecimal. For that reason you will need to load constants in hex.
The sum of the Add Binary operation occupies the full 32-bit accumulator and requires an Out
Double to move the sum to V-memory. If the value in the accumulator occupies fewer than 32
bits, leading zeros are loaded in the left-most empty bit positions.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V1400 will be loaded into the accumulator
using the Load instruction. The binary value in V1420 is added to the binary value in the
accumulator using the Add Binary instruction. The value in the accumulator is copied to
V1500 - V1501 using the Out Double instruction.
ADDB
A aaa
Discrete Bit Flags Description
SP63 On when the result of the instruction causes the value in the accumulator to be zero
SP66 On when the 16-bit addition instruction results in a carry
SP67 On when the 32-bit addition instruction results in a carr
SP70 On anytime the value in the accumulator is negative
SP73 On when a signed addition or subtraction results in an incorrect sign bit.
Handheld ProgrammerKeystrokes
LD
X1
+
1
1
(Accumulator)00
1
0A05
CC 9
000 A0 5
2C4
Acc.
CC 9
STR1
D1400
OUT1500
14 0
A
2
SHFT
B
The unused accumulator
bits areset to zero
SHFT D
ENT
SHFT
L
ENT
DD
ENT
ENT
Load the value in V1400
into the lower 16 bits of
the accumulator
LD
BIN
ADDB
OUTD
V1500
K2565
Use either OR Constant
V-memory
V1420
V1400
(V1420)
V1500
V1400
The binary value in the
accumulator is added to the
binary value in V1420
Copy the value in the lower
16bits of the accumulator to
V1500 and V1501
DirectSOFT
A05 (Hex) = 2565 (decimal)
12C4 (Hex) = 4804 (decimal)
(Accumulator) 1CC9 (Hex) = 7369 (decimal)
Operand Data Type DL250-1 Range DL260 Range
A aaa aaa
V-memory V All (See page 3-55) All (See page 3-56)
Pointer P All V mem (See page 3-55) All V mem (See page 3-56)
Constant. K 0-FFFF 0-FFFF
230
240
250-1
260
DS Used
HPP Used

Table of Contents

Other manuals for AutomationDirect DL205

Related product manuals