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

Weird behavior on C51 Simulator/Debugger

I have a doubt regarding the simulator/debugger tool. In the window displaying the code, one can see that the left-most column would be highlighted green once the line of code is executed.

My doubt is, if the code of a particular function is for example the following :

void example(char abc){ //Line 1
/*some code*/
}

is Line 1 suppose to be executed ? (Will the left column of that particular line be highlighted green?) Interestingly, my observation is that some of the functions in my program has it's first line highlighted while some don't when I execute my program.

I am also experiencing weird behavoir when the first line of the function is not executed (ie highlighted green). Using the above example, I call the function

....
example(1);
....

and pass in a value of 1 as the parameter abc. However, when my program runs to the function code itself, the value of char abc is not 1 eventhough the value passed in is clearly a 1.

I might be missing out something. Could anyone possibly provide some reasons for this unexplained behavior.

Thank you.

0