INSTRUCTION GROUPS
6 - 26
INSTRUCTION SET INTRODUCTION
MOTOROLA
2. The stack is pushed again.
A. The SP is incremented.
B. The address of the first instruction in the program loop (PC) and the current
SR contents are pushed onto the SS.
C. The LA register is initialized with the value specified in the DO instruction
decremented by one.
3. The LF bit in the SR is set. The LF bit is set when a program loop is in
progress and enables the end-of-loop detection.
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:
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
the LA and LC registers off the SS, and restoring the respective registers
3. Incrementing the PC
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.
Figure 6-13 Hardware DO Loop
1)SP+1 - SP; LA - SSH; LC - SSL; #xxx - LC
2)SP+1 - SP; PC - SSH; SR - SSL; Expr–1 - LA
3)1 - LF
START OF LOOP
END OF LOOP
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
Summary of Contents for DSP56K
Page 12: ...xii LIST of TABLES MOTOROLA List of Tables Continued Table Page Number Title Number ...
Page 13: ...MOTOROLA DSP56K FAMILY INTRODUCTION 1 1 SECTION 1 DSP56K FAMILY INTRODUCTION ...
Page 31: ...MOTOROLA DATA ARITHMETIC LOGIC UNIT 3 1 SECTION 3 DATA ARITHMETIC LOGIC UNIT ...
Page 50: ...DATA ALU SUMMARY 3 20 DATA ARITHMETIC LOGIC UNIT MOTOROLA ...
Page 51: ...MOTOROLA ADDRESS GENERATION UNIT 4 1 SECTION 4 ADDRESS GENERATION UNIT ...
Page 77: ...MOTOROLA PROGRAM CONTROL UNIT 5 1 SECTION 5 PROGRAM CONTROL UNIT ...
Page 124: ...INSTRUCTION GROUPS 6 30 INSTRUCTION SET INTRODUCTION MOTOROLA ...
Page 125: ...MOTOROLA PROCESSING STATES 7 1 SECTION 7 PROCESSING STATES STOP WAIT EXCEPTION NORMAL RESET ...
Page 167: ...STOP PROCESSING STATE MOTOROLA PROCESSING STATES 7 43 ...
Page 168: ...STOP PROCESSING STATE 7 44 PROCESSING STATES MOTOROLA ...
Page 169: ...MOTOROLA PORT A 8 1 SECTION 8 PORT A ...
Page 176: ...PORT A INTERFACE 8 8 PORT A MOTOROLA ...
Page 177: ...MOTOROLA PLL CLOCK OSCILLATOR 9 1 SECTION 9 PLL CLOCK OSCILLATOR x x d Φ VCO ...
Page 191: ...10 2 ON CHIP EMULATION OnCE MOTOROLA SECTION 10 ON CHIP EMULATION OnCE ...
Page 218: ...USING THE OnCE MOTOROLA ON CHIP EMULATION OnCE 10 29 ...
Page 604: ...INSTRUCTION ENCODING A 338 INSTRUCTION SET DETAILS MOTOROLA ...
Page 605: ...MOTOROLA BENCHMARK PROGRAMS B 1 APPENDIX B BENCHMARK PROGRAMS T T T T T P1 P3 P2 P4 T T T ...
Page 609: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 5 ...
Page 611: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 7 ...
Page 613: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 9 ...
Page 615: ...BENCHMARK PROGRAMS MOTOROLA BENCHMARK PROGRAMS B 11 ...