aboutsummaryrefslogtreecommitdiff
path: root/src/generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator.c')
-rw-r--r--src/generator.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/generator.c b/src/generator.c
index bb95e08..44fdeab 100644
--- a/src/generator.c
+++ b/src/generator.c
@@ -79,7 +79,7 @@ void gen_prologue_continue(int *bss_done) {
79 *bss_done = 1; 79 *bss_done = 1;
80} 80}
81 81
82void gen_const_declaration() { 82void gen_epilogue() {
83 fprintf(output, "\n_start:\n"); 83 fprintf(output, "\n_start:\n");
84 fprintf(output, "push rbp\nmov rbp, rsp\n\n"); 84 fprintf(output, "push rbp\nmov rbp, rsp\n\n");
85 fprintf(output, "call main\n"); 85 fprintf(output, "call main\n");
@@ -92,6 +92,9 @@ void gen_const_declaration() {
92 loc_display_table(); 92 loc_display_table();
93 fprintf(output, ";function table\n"); 93 fprintf(output, ";function table\n");
94 fun_display_table(); 94 fun_display_table();
95
96 // require a main function
97 fun_lookup("main", 0);
95} 98}
96 99
97void gen_const(const char name[], int value, Scope scope) { 100void gen_const(const char name[], int value, Scope scope) {