Keil Logo

LX51: Finding the End of the Binary


Information in this article applies to:

  • C51 All Versions

SYMPTOM

I need to locate the end of my binary image, to allow me to run a checksum on my program.

CAUSE

Set a given segment as the last, in the link order.

RESOLUTION

The LX51 linker has a feature that allows a given segment to be explicitly placed at the end of a binary image. To use this feature:

  1. Create a .C file (for example, foo.C) with a single line, as follows;

    unsigned char code EOM;
    
  2. Add foo.C to your project.
  3. Under the Project - Options for Target... - LX51 Locate tab, add the following to the User Segments box:

    ?co?*, ?pr?*, ?co?foo(last)
    
  4. EOM is now the last byte in the program binary image.

SEE ALSO

  • Refer to SEGMENTS in the LX51 User's Guide.

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.