while debugging, the compiler can't see 2 lines , when I repeated them , It can see them but I want to know if this problem in debugger only or not, I mean do I have to repeat them or not?
else if (CompState==0x05) { P1 = 0x05; P2 = 0xF8; ACK_PC(0xFA); P2 = 0xF4; // this line can't be read in debugger P1=CompDataRx[0]; // this line can't read in debugger ACK_PC(0xF9);
"while debugging, the compiler can't see 2 lines"
The Compiler has nothing to do with debugging! By the time you are debugging, the compiler has long since done its job!
See this diagram: http://www.keil.com/c51/devproc.asp
"when I repeated them"
What do you mean by that?
Sounds like you had forgotten to rebuild and/or to download your application? This is a very common mistake - even for seasoned developers!
No, I rebuild the code every time I change anything and it completes creating the hex file, but every time i write them once the debugger skip them and if i write them twice it execute them once
else if (CompState==0x05) { P2 = 0xF8; P1 = 0x05; ACK_PC(0xFA); P2 = 0xF4; P1=CompDataRx[0]; P2 = 0xF4; //again P1=CompDataRx[0]; //again ACK_PC(0xF9);
The Compiler has nothing to do with debugging! By the time you are debugging, the compiler has long since done its job! and so has the optimizer
Erik