yiqin / Compiler-Code-Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiler: Code Generation using the Stack Machine

It's in x86 Assembly/GAS Syntax. The assembly code is directly executable.

  1. Type make

  2. Type ./calc <testCase.txt >testCase.s to run the test case.

  3. Type gcc -m32 testCase.s -o testCase to build the executable file.

  4. Type ./testCase to run the executable file.

Type make clean to clean files.

Note:

  1. The symbol object get the value of the address when this symbol object is initialized.

  2. I use MacOS to write the project. Please let me know if the project doesn't work.

About


Languages

Language:C 92.7%Language:C++ 3.5%Language:Yacc 2.9%Language:Lex 0.5%Language:Makefile 0.3%Language:Assembly 0.2%