fixed bug in prepareStackForAbsOpt (rtemgr.c).
[bugg-scheme-compiler.git] / src / c / foo.c
blobb886c788f4b86e6f7575f9f96c4fd8c75a39e2ba
1 #include "scheme.h"
2 #include "assertions.h"
3 #include "arch.h"
4 #include "builtins.h"
5 #include "rtemgr.h"
7 extern SymbolNode *topLevel;
9 /* Data Segment */
11 /* Code Segment */
12 void schemeCompiledFunction() {
13 initArchitecture(8,10240);
14 initBuiltins();
16 /* 1. extend enviroment */
17 r[0] = (void*)extendEnviroment( ST_ENV() /* or NULL if sz==0 */, 0 /* curr env size */);
19 /* 2. prepare code */
20 goto Lskip1;
21 Lbody1:
22 ASSERT_ALWAYS( ST_ARG_COUNT()==/*params length*/ );
23 push((void*)fp);
24 fp = sp;
25 /* [[[compile body]]] */
26 fp = (int)pop();
27 RETURN();
28 Lskip1:
30 /* 3. create closure */
31 r_res = makeSchemeClosure(r[0],&&Lbody1);