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.

LPA 208LDP 186STP 187UB,Load a packed array. (64K system): Push a byte pointer to thefirst location following the one that contains UB , and then skip IPCpast . (128K system): Push a word pointer to the packedarray onto the evaluation stack. As the packed array iscontained in the code segment, not in the stack/heap space, a copyof the array is pushed onto the program stack. If this array has notpreviously been pushed onto the stack during the currently activeprocedure, copy onto the program stack (add one spaceto the end of the array if has an odd number ofcharacters); push a 16-bit integer onto the program stack that pointsto the first byte of the array in the procedure code; push a 16-bitlinkage pointer onto the program stack that points to the string orpacked array most recently pushed onto the program stack (thelinkage pointer is 0 if no other string or packed array has yet beenpushed onto the stack); push a pointer onto the evaluation stackthat points to the first byte of the packed array on the programstack. If the same packed array has been pushed onto the stackduring the currently active procedure, push a pointer onto theevaluation stack that points to the first byte of the array on theprogram stack. The contents of the program stack are not changed.In either case, advance the IPC register past the original copy of thearray in the code space.Load a packed field. Fetch the field indicated by the packed fieldpointer tos , and push it.Store into a packed field. Store the data tos into the field indicated bythe packed field pointer tos - 1 .Dynamic Variable AllocationNEW 1581MRK 158 31RLS 158 32Note that the NP register points to the current top of the heap (one bytebeyond the last byte in use). GDIRP is a SYSCOM field that points to the topof a temporary directory buffer above the heap.New variable allocation. tos is the size (in words) to allocate for thevariable, and tos-1 is a word pointer to a pointer variable. If the GDIRPfield is non-NIL, set GDIRP to NIL. Store the NP register into the wordpointed to by tos-1 , and increment the NP register by tos words.Mark heap. Set the GDIRP field to NIL, then store the NP register intothe word indicated by the word pointer tos .Release heap. Set the GDIRP field to NIL, then store the word indicatedby the word pointer tos into the NP register.P-Machine InstructionsIV-67

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

Saved successfully!

Ooh no, something went wrong!