This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code reduce

Hi All

I'm writing a software for 8 bit architecture using uvision 2. But when I try to compile my project using uvision2 it gives the following error

*** ERROR L107: ADDRESS SPACE OVERFLOW
.
.
.
Program Size: data=171.7 xdata=15942 code=65617
 

my target system has only 64KB code space it seems overflow.

How can I reduce code size for this application.

I'm using Code Optimisation Level 9 from uvision2.

any idea

Parents
  • more correctly:
    Hopefully, this directive will help some sloppy developers shrink program size and avoid warnings about unused code/data.

    If you need to have "delete of unused" to shrink program size, you do not work in a professional way.

    "unused segments" are quite common during development and OK at that time, but when the need to shrink program size comes up you either a) have some unused that should not be there in the first place or shrinking will not help you since the unused is to be used.

    I abhor ANY suppression of warnings.

    Erik

Reply
  • more correctly:
    Hopefully, this directive will help some sloppy developers shrink program size and avoid warnings about unused code/data.

    If you need to have "delete of unused" to shrink program size, you do not work in a professional way.

    "unused segments" are quite common during development and OK at that time, but when the need to shrink program size comes up you either a) have some unused that should not be there in the first place or shrinking will not help you since the unused is to be used.

    I abhor ANY suppression of warnings.

    Erik

Children
  • Sounds good. Perhaps this feature will motivate me to update my tools (at least once we make it past the next milestone so I can risk breaking things!)

  • "this directive will help some sloppy developers"

    Ouch!

    ""unused segments" are quite common during development and OK at that time"

    This is exactly when I need this new directive. My projects often fly close to the wire in terms of 'data' space. During development I often have quite a number of test/debugging functions in the source and it often happens that I comment out all calls to one or more of them during some test. I then get the infamous L107 warning, the linker therefore doesn't overlay locals in those functions and suddenly I have an address space overflow error. Then I have to comment out the uncalled functions, then later I have to uncomment them again, and so on.

    This feature is something quite a few of us have been waiting a long time for. Don't go telling Keil it's a bad idea now!

    "I abhor ANY suppression of warnings"

    I wouldn't be surprised if the new directive issues a warning when it removes code?

  • I wouldn't be surprised if the new directive issues a warning when it removes code?

    Nope - no warning. IF you specify this directive, the linker assumes you know what you're doing.

    You do, however, get a nice listing of all the memory you just saved.

    * * * * * * * * *   R E M O V E D     S E G M E N T S   * * * * * * * *
       *DEL*:           000020H   BYTE   UNIT     CODE           ?PR?_UNUSEDFUNC?MAIN
       *DEL*:           00000AH   BYTE   UNIT     DATA           ?DT?_UNUSEDFUNC?MAIN
    

    Jon