functions variable mapping?

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.

Parents
  • Is there a way, to make it behaive like a normal program should?

    Define "normal". Do you mean "like processors for desktop computers do it" ?

    That's not "normal". And the '51 is not a processor for a desktop computer, it's a microcontroller.

    Anyway. Andy said everything that should be said about this topic. Apart from reentrancy, there is pretty much no need for resorting to a slow, inefficient variables-on-stack approach.

Reply
  • Is there a way, to make it behaive like a normal program should?

    Define "normal". Do you mean "like processors for desktop computers do it" ?

    That's not "normal". And the '51 is not a processor for a desktop computer, it's a microcontroller.

    Anyway. Andy said everything that should be said about this topic. Apart from reentrancy, there is pretty much no need for resorting to a slow, inefficient variables-on-stack approach.

Children
More questions in this forum