dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 260

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Program Controller
;
LABEL
Note that a delay of 2 instruction words must be inserted between the instruction that updates LC and the
DOSLC instruction. Each of these words can consist of any instruction, including NOP if no useful
instruction can be placed in the sequence.
8.5.6
The DSP56800E architecture allows one hardware-accelerated DO loop to be nested within another. It is
possible to nest one hardware DO loop within another, or to nest a REP loop within a DO loop or within
two nested DO loops. The following sections describe the nesting of hardware loops.
8.5.6.1
A hardware repeat loop can be nested within a hardware DO loop without any additional setup or
processing. Example 8-10 demonstrates a repeat loop nested within a DO loop. In this example, the repeat
loop accumulates 8 values and stores the result for 10 different blocks of data.
END_NST
Note that the REP instruction does not affect the value of the loop count for the outer DO loop.
8.5.6.2
Nested looping of DO and DOSLC loops is permitted on the DSP56800E architecture. The hardware stack,
dual loop count, and dual loop address registers act as a LIFO stack for hardware looping state information.
The loop count, the “top-of-loop” address, and the state of the LF and NL bits are maintained for an outer
loop when a nested hardware loop is executed. Because the hardware stack only contains two locations,
hardware DO and DOSLC loops can only be stacked two deep.
Example 8-11 on page 8-23 demonstrates one hardware loop nested within another.
8-22
Nested Hardware Looping
MOVEU.W
NOP
NOP
DOSLC
(instructions)
MOVE.W
DO
CLR.W
REP
ADD
MOVE.W
Nesting a REP Loop Within a DO Loop
Nesting a DO Loop Within a DO Loop
Example 8-10. Example of a REP Loop Nested Within a DO Loop
#2048,LC
LABEL
X:(R0)+,X0
#10,END_NST
A
#8
X0,A
A1,X:(R1)+
Example 8-9. Using the DOSLC Instruction
X:(R0)+,X0
DSP56800E Core Reference Manual
; Specify a loop count greater than 63
; using the LC register
; (delay required due to pipeline)
; ...
; Start loop with count already in LC
; (read first value)
; Set up hardware DO loop
; (body of DO loop)
; accumulate eight values
; store result of eight accumulated values
Freescale Semiconductor

Related parts for dsp56800e