Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data
Accumulator/Stack Load and Output Data Instructions
Using the Accumulator
The accumulator in the DL205 series CPUs is a 32-bit register which is used as a temporary
storage location for data that is being copied or manipulated in some manner. For example,
you have to use the accumulator to perform math operations, such as, add, subtract, multiply,
etc.. Since there are 32 bits, you can use up to an 8-digit BCD number, or a 32-bit 2's
compliment number. The accumulator is reset to 0 at the end of every CPU scan.
Copying Data to the Accumulator
The Load and Out instructions and their variations are used to copy data from a V-memory
location to the accumulator, or to copy data from the accumulator to V-memory. The
following example copies data from V-memory location V1400 to V-memory location
V1410.
X1
Since the accumulator is 32 bits and V-memory locations are 16 bits, the Load Double and
Out Double (or variations thereof ) use two consecutive V-memory locations or 8-digit BCD
constants to copy data either to the accumulator from a V-memory address or from a V-
memory address to the accumulator. For example, if you wanted to copy data from V1400
and V1401 to V1410 and V1411 the most efficient way to perform this function would be as
follows:
X1
LD
V1400
Copy data from V1400 to the
lower 16 bits of the
accumulator
OUT
V1410
Copy data from the lower 16 bits
of the accumulator to V1410
LDD
V1400
Copy data from V1400 and
V1401 to the accumulator
OUTD
V1410
Copy data from the accumulator to
V1410 and V1411
DL205 User Manual, 4th Edition, Rev. B
V1400
8
9
3
Unused accumulator bits
are set to zero
0
0
0
0
8
9
3
Acc.
8
9
3
V1410
V1401
V1400
6
7
3
9
5
0
2
6
7
3
9
5
0
2
Acc.
6
7
3
9
5
0
2
V1411
V1410
1
2
3
4
5
6
7
5
8
5
9
10
5
11
12
13
14
A
6
B
6
C
D
6
5–53
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?