ARM Technical Support Knowledge Articles

ROM(COMPACT)

Applies to: C51 C Compiler

Answer

Information in this article applies to:


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

Article last edited on: 2006-10-24 13:38:31

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential