dsp56000 Freescale Semiconductor, Inc, dsp56000 Datasheet - Page 120

no-image

dsp56000

Manufacturer Part Number
dsp56000
Description
24-bit Digital Signal Processor Family Manual
Manufacturer
Freescale Semiconductor, Inc
Datasheet
The program loop continues execution until the program address fetched equals the LA
register contents (last address of program loop). The contents of the LC are then tested
for one. If the LC is not one, it is decremented, and the top location in the stack RAM is
read (but not pulled) into the PC to return to the start of the loop. If the LC is one, the pro-
gram loop is terminated by the following sequence:
The LF bit (pulled from the SS when a loop is terminated) indicates if the terminated loop
was a nested loop. Figure 6-14 shows two DO loops, one nested inside the other. If the
stack is managed to prevent a stack overflow, DO loops can be stacked indefinitely.
The ENDDO instruction is not used for normal termination of a DO loop; it is only used to
terminate a DO loop before the LC has been decremented to one.
6 - 26
2. The stack is pushed again.
3. The LF bit in the SR is set. The LF bit is set when a program loop is in
1. Reading the previous LF bit from the top location in the SS into the SR
2. Purging the SS (pulling the top location and discarding the contents), pulling
3. Incrementing the PC
A. The SP is incremented.
B. The address of the first instruction in the program loop (PC) and the current
C. The LA register is initialized with the value specified in the DO instruction
progress and enables the end-of-loop detection.
the LA and LC registers off the SS, and restoring the respective registers
SR contents are pushed onto the SS.
decremented by one.
1)SP+1 - SP; LA - SSH; LC - SSL; #xxx - LC
2)SP+1 - SP; PC - SSH; SR - SSL; Expr–1 - LA
3)1 - LF
1)SSL(LF) - SR
2)SP–1 - SP; SSH - LA; SSL - LC; SP–1 - SP
3)PC + 1 - PC
NOTE:
#xxx=Loop Count Number
Expr=Expression
Freescale Semiconductor, Inc.
INSTRUCTION SET INTRODUCTION
For More Information On This Product,
Figure 6-13 Hardware DO Loop
INSTRUCTION GROUPS
Go to: www.freescale.com
START OF LOOP
END OF LOOP
MOTOROLA

Related parts for dsp56000