??? 06/29/05 18:16 Read: times |
#96217 - To be taken with a pinch of salt Responding to: ???'s previous message |
Vijayganesh S said:
this will be helpful for those in the learning stage.
http://www.eventhelix.com/RealtimeM...PPCode.htm Note that this is a general page - not everything stated is applicable to the 8051. In particular, Keil C51 (and other 8051 'C' compilers, I think) does not use the stack for parameter passing nor for local variables. On an 8051, maximising local variables can reduce overall memory usage, as the compiler can overlay locals. The bit about keeping related code & data together does not apply to the 8051 - it doesn't have a cache, and it has separate code & data memory spaces anyhow. "prefer int over char" is wrong for an 8051. An 8051 is an 8-bit processor, so char is best unless something bigger is specifically needed. Keil has an option to disable the standard ANSI integer promotions. article on C to assembly translation http://www.eventhelix.com/RealtimeM...lation.htm
That link is for a 68k; it does not apply to the 8051 - especially the stuff about Stack Frames. This sort of detail will be compiler-specific - so you must always check it against the Manual for your specific compiler. |