??? 06/14/07 23:24 Read: times |
#140807 - Recursive Calls Responding to: ???'s previous message |
OCG whitepaper said:
A conventional stack is implemented in the hardware of the target MCU. – However, not all MCUs have a hardware stack. In these implementations the compiler must implement a compiled stack built at compile time rather than runtime. Although this is not a great problem for most embedded applications, it makes writing re-entrant code difficult a compiled stack cannot implement recursion or re-entrant function calls. However implementing a compiled stack transparently addresses re-entrant code by building separate call graphs for both main-line and interrupt code. Any functions that appear in more than one call graph can be replicated, each with its own local variable area. Using this technique re-entrancy can be implemented without a conventional stack. Hi Ryan, This paragraph from the whitepaper mentions the twin problems of recursive and re-entrant function calls with a compiled stack, but only mentions a solution for re-entrant calls. With OCG, are recursive calls still a problem on machines that don't have a hardware stack? -- Russ |