Keil Logo

C51: Compiler Directive for OMF2 File Format


Information in this article applies to:

  • C251 All Versions
  • C51 Version 6.21 and later
  • CX51 All Versions
  • MCBx51 Evaluation Board

QUESTION

I would like to use an 8051 with extended memory support above 64K and use far memory space structures. I would like to debug with these extended features. How can I debug these far structures if OMF-51 object file format does not support them?

ANSWER

For optimum support of these different 8051 variants with extended memory support of up to 16MB, the new output file format OMF2 was created.

OMF2 allows direct support of up to 16MB code and data space. The Intel OMF51 file format is the default for the C51 compiler. The OMF2 file format is default for the Cx51 compiler. The OMF2 directive enables the OMF2 file format, which provides detailed symbol type checking across modules and eliminates the historic limitations of the Intel OMF51 file format.

The OMF2 file format is required when you want to use one of the following features of the Cx51 compiler:

  • Variable Banking: The VARBANKING directive enables use of the far memory type.
  • XDATA ROM: Using the const xdata memory type specifies that XDATA variables are located in ROM.
  • RAM Strings: The STRING directive specifies that string constants are located in xdata or far space.
  • Contiguous Mode: The ROM (D512K) and ROM (D16M) directives enable the contiguous mode of the Dallas Semiconductor 390 and variants.

The OMF2 file format requires the extended LX51 linker/locater and cannot be used with the BL51 linker/locater.

µVision Control: Project ->Select Device ->Use LX51 instead of BL51.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.