I am using Keil uvision4.I created a new project,saved it in a new folder in the desktop.here i chose the device Infenion's C051.opening the project,I created a new file and saved it with .c extension in the same folder.the startup.obj file is in the same folder.the c prog.follows:
void main(void){ while(1){} }
on building this I get the following warnings: *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: ?C_START MODULE: STARTUP.obj (?C_STARTUP) ADDRESS: 080AH this prob. is addressed many times in this forum, but here there is no assembly prog in the C prog.the only assembly prog is startup.asm.i am unsure as to how to resolve it.
I am using the uvision4 software by Kiel
No, you're not. The company's name is Keil. Kiel would be a city in the north of Germany.
the problem is while i simulate it
No. The problem is that the compiler has managed to out-smart you long before the simulator was even started.
some statements, which are assembled, but not touched by the simulator,
First, C statements are not assembled. They're translated, or compiled. Second, your assumption that each C statement should be touched as you step through the program is incorrect. The compiler knows a whole lot better than that.
CTRELL=0x00 and CTRELH=0xFF,IEN2=0x00;in the segment if(!x) is not assembled.
Well, since they're the same in both the if and else paths of execution, the compiler rightly decided that it would be silly to emit them twice, so you don't see what you expect. And that's before we consider that 'x' is a constant zero in this code, so the compiler doesn't have to actually emit any code for it at all.
The only problem here is that your expectations are wrong. You're dealing with an optimizing C compiler here, not a simple assembler.
Thanks a lot.Great help!I am appreciating the compiler a lot better, now that I know why it did, what it did.