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 601f482..bbb2af5 100644
--- a/src/generator.c
+++ b/src/generator.c
@@ -78,7 +78,7 @@ void gen_prologue_continue(int *bss_done) {
78 *bss_done = 1; 78 *bss_done = 1;
79} 79}
80 80
81void gen_const_declaration() { 81void gen_epilogue() {
82 fprintf(output, "\n_start:\n"); 82 fprintf(output, "\n_start:\n");
83 fprintf(output, "push rbp\nmov rbp, rsp\n\n"); 83 fprintf(output, "push rbp\nmov rbp, rsp\n\n");
84 fprintf(output, "call main\n"); 84 fprintf(output, "call main\n");
@@ -91,6 +91,9 @@ void gen_const_declaration() {
91 loc_display_table(); 91 loc_display_table();
92 fprintf(output, ";function table\n"); 92 fprintf(output, ";function table\n");
93 fun_display_table(); 93 fun_display_table();
94
95 // require a main function
96 fun_lookup("main", 0);
94} 97}
95 98
96void gen_const(const char name[], int value, Scope scope) { 99void gen_const(const char name[], int value, Scope scope) {