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

Another Optimization Problem

Greetings all,

I'm fairly new to the Keil Toolset and had a question regarding the C51 code optimization levels.

It seems that on Level 8: Reuse Common Entry Code (default), the main() entry function gets completely optimized out if the main() function grows too large. I can avoid this by either changing the optimization level, or by adding the debug flag in the Output tab.

The actual assembly is correct in the .LST file, but if I check the hex file, the main() function doesn't appear at the location specified by the map file.

Is this normal behaviour? Is there some setting I'm misinterpreting somewhere?


TIA,
JG.

Parents
  • Thanks Jon,

    I was using the Keil debugger to get the disassembly. I've tested the hex file on my system (using the COM0 sfr) and I've examined the Hex file by hand as well. I don't see anything strange.

    When I build, the _only_ thing I changed was the debug info flag.

    Perhaps you _do_ have newer versions of the tools. I'm using OH51 V2.6.

Reply
  • Thanks Jon,

    I was using the Keil debugger to get the disassembly. I've tested the hex file on my system (using the COM0 sfr) and I've examined the Hex file by hand as well. I don't see anything strange.

    When I build, the _only_ thing I changed was the debug info flag.

    Perhaps you _do_ have newer versions of the tools. I'm using OH51 V2.6.

Children