aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-10-09 01:00:09 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-09 01:00:09 -0400
commit4cdbd4062dfe9266a4d7facbad00ba691e194acd (patch)
tree79240b8af451c54009cb82ee6904ba3db3200070
parenteee5bfa0f14573eb56b5404c55e5ea25f09f53d8 (diff)
Add gen_argument to push args in the correct order
-rw-r--r--gen_code.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gen_code.c b/gen_code.c
index b89b622..c244dcb 100644
--- a/gen_code.c
+++ b/gen_code.c
@@ -135,6 +135,21 @@ ptree *t;
}
+void gen_arguments(t)
+ptree *t;
+{
+ if (t->type != LIST){
+ GEN_EXPR(t)
+ fprintf(stdout, "pushq\t%s", *reg_ptr);
+
+ fprintf(stdout, "\n##ARGUMENT BOUNDARY\n");
+ return;
+ }
+
+ gen_arguments(t->r);
+ gen_arguments(t->l);
+}
+
void gen_statement(t)
ptree *t;
{