This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

local variables

suppose if i declare a local variable, where it will be stored? RAM/ROM?

Parents
  • Typically, Keil passes function parameters in registers for speed. The registers are, of course, in the internal data RAM of the 8051. I'm not sure there's any way to pass function parameters in ROM, unless the function is somehow ONLY called with constant values. Even then, I doubt any compiler would make the assumption that it's ok to put parameters in ROM.

Reply
  • Typically, Keil passes function parameters in registers for speed. The registers are, of course, in the internal data RAM of the 8051. I'm not sure there's any way to pass function parameters in ROM, unless the function is somehow ONLY called with constant values. Even then, I doubt any compiler would make the assumption that it's ok to put parameters in ROM.

Children
No data