Motorola DSP56305 Manual do Utilizador Página 32

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 112
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 31
Program Control
The Hardware Stack
MOTOROLA Optimizing DSP56300/DSP56600 Applications 3-3
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 b #0,x0
do #24,_END_LOOP
tst a
jne _CONT
enddo
_CONT
lsr a
addc x0,b
_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.
Vista de página 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 111 112

Comentários a estes Manuais

Sem comentários