Implement datum support and add make for ex-5.52

This commit is contained in:
2021-06-12 10:51:50 -04:00
parent bcabdd3212
commit 15057b52d4
7 changed files with 114 additions and 41 deletions

View File

@@ -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