Keil Logo

Command Prompt

To invoke the L166 Linker/Locator, enter L166 at the command prompt. You must include object modules and directives on the command line or specify a command-response file. The format for the L166 Linker command line is:

L166 <[>inputlist<]> <[>TO outputfile<]> <[>directives<]>
L166 @commandfile

Where

inputlist is a comma-separated list of object files (absolute or relocatable) for the linker to include in the absolute object module. You may force include object modules from library files by specifying the names in parentheses immediately after the library filename.

The inputlist uses the following general format:
filename <[>(modulename <[>, ...<]>)<]> <[>, ...<]>

where

filename is the name of an OMF166 object file (created by the A166 Assembler or C166 C Compiler) or a library file (created by the LIB166 Library Manager). The filename must be specified with a file extension—OBJ for object files and LIB for library files.
modulename is the name of an object module stored in the specified library file. A modulename may only be specified in parentheses after the name of a library file. Multiple modulenames are separated by commas.
outputfile is the name of the absolute object file the linker creates. The filename of the outputfile is used as the base for the linker MAP file. If no outputfile is specified the linker uses the filename of the first object file in the inputlist.
directives are commands and parameters that control the operation of the linker.
commandfile is the name of a command file that can contain an inputlist, outputfile, and directives.

The following command line example invokes L166, specifies the object file C:\MYDIR\PROG.OBJ, and specifies the absolute object file C:\MYDIR\PROG.ABS which the linker creates.

L166 C:\MYDIR\PROG.OBJ TO C:\MYDIR\PROG.ABS

The following example specifies three input files (SAMPLE1.OBJ, SAMPLE2.OBJ, and SAMPLE3.OBJ) which are linked. The specified absolute object module (SAMPLE.ABS) is created.

L166 SAMPLE1.OBJ, SAMPLE2.OBJ, SAMPLE3.OBJ TO SAMPLE.ABS

The following example specifies two object files (PROG1.OBJ, PROG2.OBJ) and a library file (UTILITY.LIB). The absolute object module (PROG1) is created. Externals that are not resolved from the specified object files are resolved with the public symbols of the library file. The required modules from the library are linked automatically.

L166 PROG1.OBJ, PROG2.OBJ, UTILITY.LIB

The following example shows how to force inclusion of the IN and OUT modules from the UTILITY.LIB library.

L166 PROG1.OBJ, PROG2.OBJ, UTILITY.LIB (IN, OUT)

Note

  • The L166 Linker command-line can be very long because of the number of input files and directives specified. To enter long command-lines enter an ampersand character ('&') at the end of a line to indicate that input continues on the next line. The L166 Linker prompts you with double greater-than signs ('>>') to indicate more arguments may be entered.
  • Usually, the C166 C Compiler generates uppercase SECTION, CLASS, and GROUP names. By default, the L166 Linker converts command line into uppercase. If you require lowercase names, you must enclose those names in single-quote characters (''). For example:
    L166 myfile.obj REGBANK('lower_regs' (0xFC40))
    
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.