Program Control
3
3 – 8
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.3
PROGRAM CONTROL INSTRUCTIONS
The following sections describe the primary instructions used to control
program flow.
3.3.1
JUMP 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.