AnsweredAssumed Answered

Global Variables changed in local context

Question asked by Rafael Dazcal on Mar 29, 2010
Latest reply on Mar 29, 2010 by Rafael Dazcal

Greetings,

 

If this question doesn't belong in here, please let me know where I should have posted it, instead.

 

I was debugging a program I've made for the MC9S08LC60, and I noticed something that was very strange to me.

 

I noticed that when the program enters some functions, it saves the local variables in the same physical address where some global variables reside, thus changing them!

 

Does that make any sense to any of you?

 

is it possible the compiler knows (or thinks it know) in advance which global variables it may change without affecting the program's logic?

 

I thank you in advance.

Outcomes