13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

After the registers are updated, the following takes place:o If the called procedure has a lexical level of - 1 or 0, the contents of theBASE register are saved on the evaluation stack, and the BASE registeris set to the value of the MP register.o Finally, KP is saved on top of the stack and a new value for KP iscalculated.These elements are not part of the markstack or activation record.Each time a procedure is called, another activation record is added to theprogram stack. Once again the register values and the appropriate staticlink and dynamic link are stored in the new markstack, and the systemregisters are then updated. Note that the SEG register always points to theprocedure dictionary of the segment that contains the procedure, and notthe segment that called the procedure.Once the code for a procedure has been loaded into memory, each furtherinvocation of the same procedure causes only an activation record to beadded to the program stack. The code is not loaded again.When a return from a procedure occurs, the information in the markstackfields is transferred to the system registers, and the activation record of theinactive procedure is removed from the stack.Additional information on procedure calls, and the relation of attributetables to activation records, can be found in the section "Procedure andFunction Calls" in Chapter 4.The Program Stack and the HeapIV-55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!