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.

The Evaluation StackIn the Apple II family, the evaluation stack uses a portion of the 6502hardware stack, starting at memory location $1FF and growing downwardto location $100. It is used for passing parameters, for returning functionvalues, and as an operand source for many P-machine instructions. Whenan instruction is said to push an item, that item is placed on the top of theevaluation stack (the evaluation stack grows downward). The evaluationstack is extended by loads and is reduced by stores and most arithmeticoperations.RegistersThe Apple II P-machine uses 8 pseudoregisters, and the hardware stackpointer. All registers are pointers to word-aligned structures, except theIPC register, which is a pointer to byte-aligned structures. Thepseudoregisters are the following:o SP: Evaluation Stack Pointer. This register contains a pointer to thecurrent top of the evaluation stack (one byte below the last byte in use).It is actually the Apple II hardware stack pointer.o IPC: Interpreter Program Counter. This register contains the addressof the next instruction to be executed in the currently executingprocedure. It is located at address $58.o SEG: SEGment pointer. This register points to the highest word of theprocedure dictionary of the segment to which the currently executingprocedure belongs. It is located at address $56.o JTAB: Jump TABle pointer. This register contains a pointer to thehighest word of the attribute table in the procedure code of the currentlyexecuting procedure. (Attribute tables are explained in Chapter 2.) It islocated at address $54.o MP: Markstack Pointer. This register contains a pointer to theMSST AT field, in the markstack of the currently executing procedure.Local variables in the activation record of the current procedure areaccessed by indexing off of the location pointed to by the MP register.(Markstacks are explained later in this chapter.) It is located ataddress $52.RegistersJV-47

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

Saved successfully!

Ooh no, something went wrong!