 RE: need help to debug an 80517 program Hans-Bernhard Broeker 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. |