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.

code must be loaded from the Pascal system disk. Two levels of swappingare available:o With level 1, the code that implements the 1/0 procedures REWRITE,RESET, and CLOSE is swapped out. Your program gains 2274 bytes ofmemory space.o With level 2, the code that implements the I/O procedures GET and PUTis swapped out, in addition to the level 1 code. These procedures slowdown, together with the WRITE, WRITELN, READ, and READLNprocedures that call them. Your program gains 810 more bytes for a totalgain of 3084 bytes of memory.In addition to the foregoing, the Pascal operating system uses 2048 bytes ofmemory space when it reads a disk directory. This happens during anyREWRITE, RESET, or CLOSE procedure with a block-structured device ordisk file. The space can be freed for program use by executing a MARK,RELEASE, or NEW procedure call. [128K DATA]Program SegmentationTo make the most efficient use of the memory space available for programcode and data, you can divide programs into segments. This section givesessential information on how Apple Pascal implements segmentation.A segment is code (or data space) that can be loaded into memory by itself,independent of other segments. Every program consists of at least onesegment, and some programs consist of many segments. Whenever aprogram is compiled, the Compiler and Linker create the followingsegments in the codefile:o Each SEGMENT procedure or function becomes a segment in thecodefile.o Each Regular Unit that the program uses becomes a segment in thecodefile.o The main program itself becomes a segment in the codefile. Thisincludes the program's non-SEGMENT procedures and functions.Similarly, whenever a Regular Unit is compiled, the result is a code segmentfor the unit itself, plus an additional segment for each Regular Unit that isused within the unit being compiled. (Note that SEGMENT procedures andfunctions are not allowed inside units.)III-248Chapter 15: Large Program Management

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

Saved successfully!

Ooh no, something went wrong!