Texas Instruments TMS320C2XX Calculator User Manual


 
Branches, Calls, and Returns
5-9
Program Control
By the time the unconditional call instruction reaches the execute phase of the
pipeline, the next two instruction words have already been fetched. These two
instruction words are flushed from the pipeline so that they are not executed,
the return address is stored to the stack, and then execution continues at the
beginning of the called function. The unconditional call instructions are CALL
and CALA (call subroutine at location specified by accumulator).
5.3.3 Unconditional Returns
When an unconditional return (RET) instruction is encountered, it is always
executed. When the return is executed, the PC is loaded with the value at the
top of the stack, and execution resumes at that address.
By the time the unconditional return instruction reaches the execute phase of
the pipeline, the next two instruction words have already been fetched. The
two instruction words are flushed from the pipeline so that they are not
executed, the return address is taken from the stack, and then execution con-
tinues in the calling function.