humberto-ortiz / compilers-2020

Example code for Spring 2020 Compilers course.
0 stars 8 forks source link

Modified type env and bug fixes on compiling functions. #15

Open alcanie1 opened 4 years ago

alcanie1 commented 4 years ago

Modified type env so that it supports local vars and function arguments. Local vars are stored and accessed using the RSP register as reference (RSP - 8i). Function arguments are accessed using RBP register as reference (RBP + 8i).

Compiling function calls now compiles every argument and pushes them to the stack starting at the rightmost argument and finishing with the leftmost.

Added the missing Pop RBP instruction missing in the compilation of function declarations.