From: Ojala Pasi 'Albert' (albert_at_cs.tut.fi)
Date: 2002-10-05 17:51:05
> The problem here is: When the inner procedure (P4) stores something into the > variable I which lives in another stack frame, it does not know, where this > frame resides on the stack. > > There are two solutions for this problem. One is called displays, the second > one frame links. C does not have this problem, because it does not have the possibility to define functions in function scopes. Only applies to Pascal.. In C you have either absolute addresses (global/static scope) or stack-relative addresses (function parameters / stack variables). I have written a Pascal compiler for SPARC (single-pass code generation, dual-pass assembly compilation) and a C compiler for a DSP (with a very heavy backend optimizer/parallelizer with constant expression evaluation and some other optimization stuff). -Pasi -- "It doesn't do to push a man too much; it makes him stubborn. One can't expect logic from males; they think with their testicles and act from their emotions." -- Robert A.Heinlein "The Number of the Beast" Message was sent through the cbm-hackers mailing list
Archive generated by hypermail 2.1.4.