Keil Logo

Command Prompt

To invoke the LX51 Linker/Locator, enter LX51 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 LX51 Linker command line is:

LX51 <[>inputlist<]> <[>TO outputfile<]> <[>directives<]>

LX51 @commandfile


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 formats:
filename <[>(modulename <[>, ...<]>)<]> <[>, ...<]>
common {filename <[>(modulename <[>, ...<]>)<]>} <[>, ...<]>
bankx {filename <[>(modulename <[>, ...<]>)<]>} <[>, ...<]>


filename is the name of an OMF51 object file (created by the assembler or compiler) or a library file (created by the 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.
common specifies modules that are located in the common area (in a code banking program only).
bankx specifies modules that are located in code bank x (in a code banking program only).
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 may contain an inputlist, outputfile, and directives.

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


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.


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.


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



  • The LX51 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 LX51 Linker prompts you with two greater-than signs ('>>') to indicate more arguments may be entered.

Related Knowledgebase Articles

  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.