diff options
Diffstat (limited to 'src/generator.c')
-rw-r--r-- | src/generator.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/generator.c b/src/generator.c index 9948966..e7a33c8 100644 --- a/src/generator.c +++ b/src/generator.c | |||
@@ -137,6 +137,13 @@ Type gen_function_call(const char name[], int nb_param) { | |||
137 | return return_type; | 137 | return return_type; |
138 | } | 138 | } |
139 | 139 | ||
140 | void gen_function_param_passing(int nb_params) { | ||
141 | for(int i = 1; i <= nb_params; i++) { | ||
142 | fprintf(output, "mov r8, [rbp + %d]\n", (nb_params - i + 2) * 8); | ||
143 | fprintf(output, "mov [rbp - %d], r8\n", i * 8); | ||
144 | } | ||
145 | } | ||
146 | |||
140 | void gen_declaration(const char name[], Type type, Scope scope) { | 147 | void gen_declaration(const char name[], Type type, Scope scope) { |
141 | switch (scope) { | 148 | switch (scope) { |
142 | case GLOBAL: | 149 | case GLOBAL: |