Hi, I am using c51 keil compiler with cygnal chip c8051C020. I find problem in initilise static variable. exp. main() { static unsigned char i =0 ; i++; } when i write this type of code & simulate it ,i find that i is not initilise to 0. Note:this is just example code & not the actual program i work. If any specify me the reasion it will help me lot. Regards, Pandurang S.
still i have facing the same problem (i.e. static variable not initilise to proper value). if you are using internal XRAM you will not, unless you put all memory related initialize at the very beginning of (a renamed copy of) startup.a51. Erik
"if you are using internal XRAM you will not, unless you put all memory related initialize at the very beginning of (a renamed copy of) startup.a51." I don't understand what you're trying to say here, so I doubt the OP will be able to make much sense of it. Can you explain better?
I don't understand what you're trying to say here, so I doubt the OP will be able to make much sense of it. Can you explain better? If you "knew" the f020 the OP is using, you would. The f020 has a rather intricate memory configuring process and if that is not dome before the "clear XRAM" in startup and "init XRAM variables" in init, the processes are writing "out in thin air" Erik
"The f020 has a rather intricate memory configuring process and if that is not dome before the "clear XRAM" in startup and "init XRAM variables" in init, the processes are writing "out in thin air"" I thought that one defaulted to using internal XDATA?
I thought that one defaulted to using internal XDATA? you're right this one does.