Implement datum support and add make for ex-5.52
This commit is contained in:
@@ -98,17 +98,21 @@
|
||||
|
||||
(define c-preamble '(
|
||||
"#include <stdio.h>"
|
||||
"#include \"scm_support.h\""
|
||||
"#include <stdint.h>"
|
||||
"#include <stdlib.h>"
|
||||
""
|
||||
"#include \"datum.h\""
|
||||
""
|
||||
"int main() {"
|
||||
" int val;"
|
||||
" int *argl;"
|
||||
" void *cont, *entry, *proc, *env;"
|
||||
" datum *val;"
|
||||
" datum *argl[10];"
|
||||
" datum *proc;"
|
||||
" void *cont, *entry, *env;"
|
||||
""
|
||||
))
|
||||
|
||||
(define c-epilog '(
|
||||
" printf(\"%u\\n\", val);"
|
||||
" printf(\"%u\\n\", val->value);"
|
||||
"}"
|
||||
))
|
||||
|
||||
@@ -133,7 +137,7 @@
|
||||
(display "]") (newline)
|
||||
(close-output-port port)))
|
||||
|
||||
(compile-to-file "shared/scm2c/main.c" '(+ 1 1))
|
||||
(compile-to-file "shared/scm2c/main.c" '(+ 42 3))
|
||||
|
||||
; write assembly to file for debug purposes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user