Hello,
I was hoping someone could tell me how the memory works during functions call out of main.
In regular C and C++, after functions return, the memory is free again.
How does it work in the 8051 using C?
For example:
void myFunc() { int VAR = 1; }
When the function gets called does VAR use data memory or code memory? When it returns, is the memory that VAR used, free to be used again?
Thanks.
"In regular C and C++, after functions return, the memory is free again"
In "regular" C, automatic variables are usually allocated on the stack. The 8051 doesn't have any stack worth speaking of, so another approach is needed - search the Keil site for "Overlaying"...
See also:
http://www.keil.com/support/man/docs/c51/c51_le_funcparmsstack.htm
http://www.keil.com/support/man/docs/c51/c51_le_reentrantfuncs.htm