The Hardware Stack - Motorola DSP56600 Manual

Application optimization for digital signal processors
Table of Contents

Advertisement

Note: The BRKcc instruction has the same functionality as the C
language "break", (i.e., terminating the loop and resuming
execution after the end of the loop). A similar instruction is
the ENDDO instruction, which exits the loop after finishing
the current loop iteration. ENDDO is not a conditional
instruction, therefore normal use generally includes testing a
condition and skipping the ENDDO instruction accordingly.
The following example counts the number of bits in A1, terminating
if the register turns 0 before the full 24 iterations.
clr
do
tst
jne
enddo
_CONT
lsr
addc
_END_LOOP
Bit 0 of the result (B1) could be used as the parity of the original
operand (A1).
Note: Both ENDDO and BRKcc have sequence restrictions, as
shown in the DSP56300 and DSP56600 Family Manuals ,
Appendix B.
3.2

THE HARDWARE STACK

The DSP56300/DSP56600 hardware stack enables the user to nest
DO loops and subroutines (called by software or interrupts) with no
software overhead. With the Stack Extension enabled, the hardware
stack can accommodate an unlimited nesting level of DO loops,
JSRs, or a combination of them. The only overhead of a very deep
nesting level is some additional cycles required to copy data to or
from the stack extension memory. Examples of stack extension use
are given in Section 3.3 on page 3-7.
The hardware stack mechanism works in parallel to opcode
execution, thus saving execution time, as well as software overhead
compared to conventional software stacks. These advantages make
the DSP56300/DSP56600 especially suitable for multi-tasking, and
running real-time operating systems and program code generated
from high-level languages.
MOTOROLA
Optimizing DSP56300/DSP56600 Applications
b
#0,x0
#24,_END_LOOP
a
_CONT
a
x0,b
Program Control
The Hardware Stack
3-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dsp56300

Table of Contents