As I can see, the keil compiler doesnt use regular stack for functions, and all the local variables inside functions are mapped in global memory. Is there a way, to make it behaive like a normal program should? I.E - create a local variables in ram,and destroy them, when the function ends? Thank you.
based on your posts above I gather that some idiot at some institution of lower learning told you that C is device independent. That is TOTAL AND UTTERLY BULLSHIT C will be implemented by any decent compiler the best way the underlying processors architecture allow If you have taken the decision not to understand the difference between a PC and a '51, good luck getting anywhere. Erik
2erik: amazing. Post with no information whatsoever. I would like to see the end of debate between Andy and Christoph, though.
C is device independent. That is TOTAL AND UTTERLY BULLSHIT Is that not 'information'? If he actually believe that C is device independent, then this could very well be the best information in the whole thread Erik
"I would like to see the end of debate between Andy and Christoph, though." Meanwhile, you should read the App Note for yourself and decide what, if any, of it applies to and/or helps in your specific circumstances...
Ok, from the appnote: * If you use function pointers, you must adjust the calling tree manually. Exception: * If you only use an array of constant function pointers stored in code memory (which is pretty much a fancy way of implementing a jump table), the compiler and linker are usually smart enough to figure things out on their own. However, I think there's plenty of ways that will mess up the exception. Some clever person might, for example, modify the array of function pointers in code memory and still expect their code to work properly. Or they use the array in several different functions all over the place and still expect the compiler/linker to be able to follow their train of thought.
it seems to be time for the old one the '51 ain't no PC that should settle it. a footnote: this is about the '51, not about Keil. Whatever Keil does, the compiler can not change the architecture of the microcontroller Erik