\documentstyle[a4,12pt]{article}
\begin{document}
\author{APM Manual pages}
\title{LINK command}
\maketitle
\parskip .1 in
\setcounter{secnumdepth}{10}
\noindent

\section{Preamble}
The LINK command may be used to consolidate a group of object modules,
resolving the external references made within the group.

The command operates on "FE02" object modules generated by the Imp and
Pascal compilers, or the assembler when used in conjuntion with include
file "inc:module.asm".

Owing to incompatibilities between V2 and V3 compilers, two variants
of the command exist: LINK2 for modules compiled by version 2 compilers,
and LINK3 for modules compiled by version 3 compilers.

At present (September 1986), LINK is equivalent to LINK2.

\section{LINK2}
To use: LINK2 Mainfile,Auxfile1,.../Outfile-Options

Up to 19 auxiliary files may be specified.
If the output filename is omitted, the same name as the main file is used.

\subsection{Parameters}
\subsubsection{Mainfile}
The name of the object file (.MOB extension assumed) containing the main
module of the group. This will normally be a main program, but this is
not compulsory.

\subsubsection{Auxfile1 ... Auxfile19}
The names of object files containing further modules to be linked with
the main file.

\subsubsection{Outfile}
The name of the file to receive the resulting object module. If omitted,
the output is sent back into the main file.


\subsection{Options}
\subsubsection{Include, Exclude}
By default the output module will export only those entries which are
exported by the input modules and were not used to satisfy any internal
references.

This may be over-ridden by using the INCLUDE and EXCLUDE parameters.
If present, they are either "*" or a filename.
If "*", this means all exports are to be in/excluded in the output,
if a filename (which may be the terminal (":")), then a list of export names
to be in/excluded are read from the specified file.

If one is specified as "*", it will be processed before the other, so that
the other is always a list of exceptions to the first.
Specifying "*" for both is daft.

\subsubsection{Debug}
This boolean parameter is irrelevant except for debugging the linker itself.

\subsubsection{Dynamic}
If this boolean parameter is specified, any dynamic references are left
as such. Otherwise (the default), these are converted into ordinary
external references

\subsubsection{Auto}
If this boolean parameter is specified, the linker will search the
current external dictionary to determine which object files are required.
This eliminates the need to type in long lists of object filenames,
provided the necessary ones have been INSTALLed.

\subsubsection{Disregard}
This parameter (relevant only when -auto is specified), is a filename.
The file contains a list of object file names NOT to be inculded by
the automatic scanning. The default DISREGARD-file is UTILS:LINK.DAT
which causes the linker to exclude most of the standard run time libraries
which are normally preloaded (or at least installed) on all machines.


\subsection{Restrictions}
\subsubsection{Part-linking}
For the moment it is not recommended to part-link a collection of modules,
either for further linking, or for installing.

More precisely, you are likely to get into trouble if any included
exports are not from the first module of the parameter list (Mainfile).

In other words, it should be OK to part-link A with B and C, provided that,
at run-time, the exports made by B and C are only used by A, B, or C, not
by the main program or other modules loaded with it.

\subsubsection{Dynamic references}
Believed dodgy. Hence the -DYNAMIC parameter is off by default.

\subsubsection{Size of output file}
Things may go wrong if the combined size of the output code and data
areas exceeds 64K.



\section{LINK3}
blurb blurb

Fails: Unbalanced brackets
