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.

CGP 207 UB Call global procedure. Call procedure number UB , which is at lexicallevel 1 and in the same segment as the currently executing procedure. TheMSSTAT field (static link) of the markstack is set to the value of theBASE register.CIP 174 UB Call intermediate procedure. Call procedure number UB in the samesegment as the currently executing procedure. The MSST AT field (staticlink) of the markstack is set by looking up the dynamic chain (MSDYNfields) until an activation record is found whose caller had a lexical levelone less than the procedure being called. Use that activation record'sMS STAT field (static link) as the static link of the new markstack.CBP 194 UB Call base procedure. Call procedure number UB , which is at lexicallevel -1or0. The MSSTAT field (static link) of the markstack is set tothe MSST AT field in the activation record of the procedure pointed to bythe BASE register. The value of the BASE register is saved on theevaluation stack, after which it is set to point to the MSST AT field of theactivation record just created.CXP 205 UB1,UB2 Call external procedure. Call procedure number UB2 , in segmentUBl . Used to call any procedure not in the same segment as the callingprocedure, including base procedures. If the desired segment is notalready in memory, it is read from disk. Build an activation record.Calculate the static link for the markstack (if the called procedure has alex level of - 1or0, set as in the CBP instruction; otherwise set as in theCIP instruction).CSP 158 UB Call staJll.dard procedure. Used to call standard procedures built intothe P-machine.RNP 173 DB Return from nonbase procedure. DB is the number of words thatshould be returned as a function value (0 for procedures, 1 for nonrealfunctions, and 2 for real functions). Copy DB words from the higheraddresses of the current procedure's activation record, and push themonto the evaluation stack. Then copy the information in the currentprocedure's markstack fields into the pseudoregisters to restore the callingprocedure's correct environment.RBP 193 DB Return from base procedure. Move the value of the BASE registersaved on the evaluation stack by a CBP, back into the BASE register, andthen proceed as in the RNP instruction.IV-74Chapter 4: The P-Machine Instruction Set

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

Saved successfully!

Ooh no, something went wrong!