Reading Integer Data From An Accumulator; Using 16-Bit Results Of Dsp Algorithms; Saving And Restoring Accumulators - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

Data Arithmetic Logic Unit
Loading a 16-bit integer value into the A1 portion of the register is generally discouraged. In almost all
cases, it is preferable to follow Example 3-1 on page 3-11. One notable exception is when 36-bit
accumulator values must be stored temporarily. See Section 3.2.5, "Saving and Restoring Accumulators,"
for more details.
3.2.3.2

Reading Integer Data from an Accumulator

Integer and control processing algorithms typically involve the manipulation of 16-bit quantities that
would be adversely affected by saturation or limiting. When such integer calculations are performed, it is
often desirable not to have overflow protection when results are stored to memory. To ensure that the data
ALU's data limiter is not active when an accumulator is being read, it is necessary to store not the full
accumulator, but just the MSP (A1 portion). See Example 3-2.
Example 3-2. Reading a Word from an Accumulator for Integer Processing
MOVE
A1,X:Variable_1; Saturation is disabled
Note that with the use of the A1 register instead of the A register, saturation is disabled. The value in A1 is
written "as is" to memory.
3.2.4

Using 16-Bit Results of DSP Algorithms

A DSP Algorithm may use the full 36-bit precision of an accumulator while performing DSP calculations
such as digital filtering or matrix multiplications. Upon completion of the algorithm, however, sometimes
the result of the calculation must be saved in a 16-bit memory location or must be written to a 16-bit D/A
converter. Since DSP algorithms process digital signals, it is important that when the 36-bit accumulator
value is converted to a 16-bit value, saturation is enabled so signals that overflow 16 bits are appropriately
clipped to the maximum positive or negative value. See Example 3-3.
Example 3-3. Correctly Reading a Word from an Accumulator to a D/A
MOVE
A,X:D_to_A_data; Saturation is enabled
Note the use of the A accumulator instead of the A1 register. Using the A accumulator enables saturation.
3.2.5

Saving and Restoring Accumulators

Interrupt service routines offer one example of a time when it is critical that an accumulator be saved and
restored without being altered in any way. Since an interrupt can occur at any time, the exact usage of an
accumulator at that instant is unknown, so it cannot be altered by the interrupt service routine without
adversely affecting any calculation that may have been in progress. In order for an accumulator to be saved
and restored correctly, it must be done with limiting disabled. This is accomplished through sequentially
saving and restoring the individual parts of the register, and not the whole register at once. See
Example 3-4 on page 3-13.
3-12
DSP56800 Family Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents