- •3.1 OVERVIEW
- •3.2 PROGRAM SEQUENCER
- •3.2.1 Next Address Select Logic
- •3.2.2 Program Counter & PC Stack
- •3.2.3 Loop Counter & Stack
- •3.2.4 Loop Comparator & Stack
- •3.3 PROGRAM CONTROL INSTRUCTIONS
- •3.3.1 JUMP Instruction
- •3.3.1.1 Register Indirect JUMPs
- •3.3.2 CALL Instruction
- •3.3.3 DO UNTIL Loops
- •3.3.4 IDLE Instruction
- •3.3.4.1 Slow IDLE
- •3.4 INTERRUPTS
- •3.4.1 Interrupt Servicing Sequence
- •3.4.2 Configuring Interrupts
- •3.4.2.1 Interrupt Control Register (ICNTL)
- •3.4.2.2 Interrupt Mask Register (IMASK)
- •3.4.2.3 Global Enable/Disable for Interrupts
- •3.4.2.4 Interrupt Force & Clear Register (IFC)
- •3.4.3 Interrupt Latency
- •3.4.3.1 Timer Interrupt Latency on ADSP-2101, ADSP-2105, ADSP-2115, ADSP-2111
- •3.5 STATUS REGISTERS & STATUS STACK
- •3.5.1 Arithmetic Status Register (ASTAT)
- •3.5.2 Stack Status Register (SSTAT)
- •3.5.3 Mode Status Register (MSTAT)
- •3.6 CONDITIONAL INSTRUCTIONS
- •3.7 TOPPCSTACK
- •3.7.1 TOPPCSTACK Restrictions
3 Program Control
Note: Caution is required when ending a loop with a JUMP, CALL, RETURN, or IDLE instruction, or when making a premature exit from a loop. Since none of the loop sequencing mechanisms are active while the jump/call/return is being performed, the loop, PC, and counter stacks are left with the looping information (since they are not popped). In this situation, a manual pop of each of the relevant stacks is required to restore the correct state of the processor. A subroutine call poses this problem only when it is the last instruction in a loop; in such cases, the return causes program flow to transfer to the instruction just after the loop. Calls within a loop that are not the last instruction operate as in Case 1.
The only restriction concerning DO UNTIL loops is that nested loops cannot terminate on the same instruction. Since the loop comparator can only check for one loop termination at a time, falling out of an inner loop by incrementing the PC would go beyond the end address of the outer loop if they terminated on the same instruction.
3.3PROGRAM CONTROL INSTRUCTIONS
The following sections describe the primary instructions used to control program flow.
3.3.1JUMP Instruction
The 14-bit jump address is embedded in the JUMP instruction word. When a JUMP instruction is decoded, the jump address is input directly to the next address mux of the program sequencer. The address is driven onto the PMA bus and fed back to the PC for the next cycle. The following instruction, for example,
JUMP fir_start;
jumps to the address of the label fir_start.
3.3.1.1 Register Indirect JUMPs
In this case of register indirect jumps, the jump address is supplied by one of the I registers of DAG2 (I4, I5, I6, or I7). (Data address generators are described in Chapter 4.) The address is driven onto the PMA bus by DAG2, and is loaded into the PC on the next cycle. For example, the instruction
JUMP (I4);
will jump to the address contained in the I4 register.
3 – 8