diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 09:56:19 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-09 09:56:19 -0400 |
commit | 698dd8d2ebcba45a79c6126c698991110d0c9a76 (patch) | |
tree | c91029b2cfb72b1a9f7e2487c8b772bd8fe30d1c | |
parent | e96b0e885aecc66377fc020a74169ceaea450a38 (diff) |
Add Multiply /Division code generation
-rw-r--r-- | gen_code.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -123,9 +123,12 @@ int c; break; case MUL: fprintf(stdout, "imulq\t"); + if (c == 1) + goto case1; + goto case23; break; case DIV: - fprintf(stdout, "idivq\t"); + gen_load(t); break; default: fprintf(stderr, "OPVAL: %d\n", t->attr.opval); @@ -229,6 +232,8 @@ ptree *t; gen_load(t->l); fprintf(stdout, "negq\t%s\n", *reg_ptr); break; + case DIV: + yyerror("DIV not imlemented\n"); default: fprintf(stdout, "movq OTHER"); } |