Figure 10.8a illustrates the use of procedures to construct a program. In this example, there is a main program starting at location 4000. This program includes a call
to procedure PROC1, starting at location 4500. When this call instruction is encountered, the processor suspends execution of the main program and begins execution of
PROC1 by fetching the next instruction from location 4500. Within PROC1, there
are two calls to PROC2 at location 4800. In each case, the execution of PROC1 is suspended and PROC2 is executed. The RETURN statement causes the processor to go
back to the calling program and continue execution at the instruction after the corresponding CALL instruction. This behavior is illustrated in Figure 10.8b
đang được dịch, vui lòng đợi..