Keil Logo

Object (OBJ) File

The C51 Compiler produces object (.OBJ) files in OMF51 or OMF2 object format in response to various C language statements and other directives. The OBJECT directive specifies the name for the object file while the NOOBJECT directive inhibits object file output.

The object file is not simply a binary representation of the assembly generated for your C source code. It is a specially formatted file with data records for symbolic information, object code, debugging information, library references, and so on. Following are just a few of the details that are stored in the object file.

  • Reserved memory for global variables.
  • Public symbol (variable and function) names.
  • External symbol (variable and function) references.
  • Library files with which to link.
  • Debugging information to help synchronize source lines with object code.

Most of the object code stored in the object file is not absolute. It may be located by the linker at any appropriate address. References to external variables and functions are set to address 0 by the compiler. The linker fixes-up all references. For these reasons, the object code generated by the compiler is not executable as-is. It must be linked before it can be executed.

The level of detail stored in the object file makes it possible for simulators (like the Keil µVision Simulator), debuggers (like the Keil µVision Target Debugger), and emulators to load your program and provide complete symbolic, source-level debugging capabilities.


  • The object file provides references to line numbers within the original source code. It does not include the original source code. Source-level debugging requires that the debugger have access to the original source code.
  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.