4.2. Librarian

Version II.0, February 1979

page221 LIBRARY.CODE is a utility program that allows the user to link separately compiled PASCAL units and separately assembled subroutines into a LIBRARY file. It is based upon the original pre-I.5 utility LINKER.CODE and operates in basically the same way.

To add a segment to *SYSTEM.LIBRARY it is necessary to create a new file into which each segment that is wanted from the original *SYSTEM.LIBRARY is first linked. It is then possible to add segments by linking from another code file into the new file being created.

Example

Consider the case of adding a segment called TURTLE to the already existing file *SYSTEM.LIBRARY which is assumed to contain the segments PSGRAPHICS and MOVETO.

On executing LIBRARY.CODE, the user is prompted for the name of the output code file. For this example, respond with the name NEW.LIBRARY. The program now asks for a ‘Link Code File’. The response here is *SYSTEM.LIBRARY. The names of all segments currently linked into the input library, i.e. *SYSTEM.LIBRARY, as well as their length in bytes is now displayed. Currently there are a maximum of 16 segments in any PASCAL program or LIBRARY.

0-MOVETO2398 4-         0 8-         0 12-         0
1-PSGRAPHI864 5- 0 9- 0 13- 0
2- 0 6- 0 10- 0 14- 0
3- 0 7- 0 11- 0 15- 0

The following prompt line appears:

Segment # to link and <space>, N(ew file, Q(uit, A(bort
The user now enters the number of a segment within the link code file that is to be linked into the new library file, followed by <space>. Next, the number of the segment in the output file to be linked into (i.e. NEW.LIBRARY) is typed followed by <space>. For each segment linked the librarian reads that segment from the input file and writes it to the output file at the segment requested. It then displays the segment table for the current state of the output library file. In this example, respond with the following: page222
0< space>
Seg to link into? 0<space>
1<space>
Seg to link into? 1<space>

When all needed segments have been linked a new input file is requested by typing ‘N’ for N(ew tile. In this example, a separately compiled PASCAL UNIT called TURTLE is assigned to exist in a code file called TGRAPHICS.CODE. See section 3.2, UNITS. On entering the name of this file the following display appears:

0-         0 4-         0 8-         0 12-         0
1- 0 5- 0 9- 0 13- 0
2- 0 6- 0 10-TURTLE230 14- 0
3- 0 7- 0 11- 0 15- 0

The Unit TURTLE occurs In segment 10 and is to be linked into segment 2 within NEW.LIBRARY. The user responds:

10<space>
Seg to link into? 2<space>

The final display of the output library segment table is thus:

0-MOVETO2398 4-         0 8-         0 12-         0
1-PSGRAPHI864 5- 0 9- 0 13- 0
2-TURTLE0 6- 0 10- 0 14- 0
3- 0 7- 0 11- 0 15- 0

The output library code file length is displayed and in this example is 16 (blocks long).

Once the needed segments from all input files have been linked in the user locks the output file by typing ‘Q’ followed by a return, (unless a copyright notice is desired within the code file). Type ‘A’ to abort the linking process. The old *SYSTEM.LIBRARY should either be removed or its name changed if it resides upon the same disk and the name NEW.LIBRARY must be changed to *SYSTEM.LIBRARY in order to be used.

page223 Note

In response to the initial prompt “Output Code File ->” we could have just as easily said *SYSTEM.LIBRARY followed by another *SYSTEM.LIBRARY in response to the prompt “Link Code File ->”. However, in this case the original *SYSTEM.LIBRARY will be removed automatically upon completion of the linking process. Typing just * is a sufficient abbreviation for *SYSTEM.LIBRARY.
page224


This page last regenerated Sun Jul 25 01:09:11 2010.