Linking Programs with the Linker

ProView invokes the Linker automaticly during a MAKE or a BUILD ALL.  You run MAKE or BUILD ALL from the PROJECT menu in ProView. If you have a fatal error in one of you source files (*.C or *. A51) and the Compile or Assemble phase fails, ProView will NOT attempt to invoke the Linker. All source files in the project MUST translate before the Linker will be run.

You may also invoke the DOS Linker by typing L51  at the DOS prompt and pressing ENTER. You can include object modules and directives on the command line or you may specify a command input file. Use one of the following command-line formats:
L51  inputlist  TO  outputfile  directives
or
L51 @commandfile

where:

inputlist

is a list of the object files, separated by commas, for L51 to include in the final absolute object module. The files named in the inputlist  contain relocatable program modules which are combined to form the final absolute object module. Additionally, you may force the inclusion of modules from library files by specifying their names in parentheses immediately following the library file name.

Outputfile

is the name of the absolute object file that L51 creates. If no outputfile  is specified on the command line, the first filename in the input list is used. The basename of the outputfile  is used as base for the .M51  map file.

Directives

are commands and parameters that control the operation of L51.

Commandfile

is the name of a command input file that may contain an inputlist, outputfile, and directives.

The inputlist  uses the following general format:
filename  (modulename  ,   )  ,  

where:

filename

is the name of an object file created by C51 or A51 or a library file created by LIB51. The filename  must be specified with the file extension. Object files use the extension .OBJ.  Library files use the extension .LIB.

modulename

is the name of an object module in the library file. The modulename  can only be used after the name of a library file. The modulenames  must be specified in parenthesis after the filename. Multiple modulenames  may be separated by commas.

Long Command Lines

The invocation line for L51 can be very long due to the number of input files and directives that are specified. L51 allows you to enter very long command lines by using the ampersand character (&) as the last character in a line to indicate that you want to enter more arguments. L51 will prompt you with a double greater-than sign (>>) to indicate that you may enter more arguments for L51.

Command Files

In addition to using the ampersand character, you can specify all command-line arguments for the linker in a command file. This has the same format as a normal command line and may be produced by a text editor. L51 interprets the first filename preceded by an at sign (@) to be a command file.

Output File

L51 creates an output file using the input object files that you specify on the command line. The output file is an absolute object file that may be loaded by DS51 for debugging. In addition, you can use OHS51 to create an Intel HEX file from the absolute object file.