??? 04/13/07 07:38 Read: times |
#137122 - More precisely Responding to: ???'s previous message |
Russell Bull said:
recursion and re-entrancy are concepts not only applicable to embedded 'c' ... This is all fundamental computer science stuff Absolutely - see any decent 'C' and/or computer science textbook For a function to be re-entrant, it must create a copy of its variables each time it is called Which pretty much rules out the use of 'static' variables... Many of the 8051 compilers do not generate re-entrant code. This is due to the limited memory space of these cpus. Not exactly. The limitation is the 8051's Stack Size. The 8051's stack must be in IDATA - which is inherently limited to 128 bytes on an 8051, or 256 bytes on an 8052. There are a few derivatives (deviates?) with extended Stacks but, in general, the Stack cannot be extended no matter how much total memory your system has! On other cpus with more memory space, compilers usually will allocate local variable space on the stack It's not so much that these CPUs have more memory space - but that they can extend their stack to use that space. In fact, most 'C' compilers do use the stack for automatic variables - the 8051 is very much the exception in this! Therefore you will find that a lot of general texts will assume that the stack is used for automatic variables; this assumption does not hold for (most) 8051 compilers! |
Topic | Author | Date |
embedded c | 01/01/70 00:00 | |
Not just embedded 'c' | 01/01/70 00:00 | |
More precisely | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 | |
of what?![]() | 01/01/70 00:00 | |
An example? | 01/01/70 00:00 |