Keil Logo

C51: ROM(COMPACT)

Information in this article applies to:

  • C51 Version 5.50

SYMPTOMS

I'm using the Keil 8051 C Compiler V5.0 with bank switching. We are looking for code space savings, and I've found that the linker reports the following gaps in our application:

BANK1   EFB9H     0031H     INBLOCK      ?PR?_KEYTOCONTROLCODE?PROGRAM
                EFEAH     0016H                  *** GAP ***
BANK1   F000H     026DH     INBLOCK      ?PR?DIAGNOSTICS?DIAG

BANK1   F637H     0031H     INBLOCK      ?PR?_CONTROLCODETOKEY?PROGRAM
                F668H     0198H                  *** GAP ***
BANK1   F800H     03F1H     INBLOCK      ?PR?PROGRAM?PROGRAM

Is there something that I can do to minimize these gaps in the linker's placement of modules?

CAUSE

These gaps are caused by using the ROM(COMPACT) directive to reduce program function size. When you compile with the ROM(COMPACT) directive, each segment must fit in an INBLOCK (2K page). With ROM(COMPACT), JMPs coded inside a function are implemented using the AJMP instruction, therefore, each function MUST fit within a 2K block.

RESOLUTION

If you change the large functions (or even the whole program) to be ROM(LARGE), the compiler uses LJMPS within the function and the function may cross over 2K boundaries.

MORE INFORMATION

  • Refer to ROM in the Cx51 User's Guide.

Last Reviewed: Tuesday, October 24, 2006


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.