MINIC_TO_ASSEMBLY_PROJECT
- In this I created a compiler which translates a mini C program to Assembly.
- This project has been written in C++ and with flex/bison and I programmed it in Visual Studio 2019.
- In order to see this program working you need to write a C program in "CProgram.txt" file and then rebuild.
- The results will be appeared in "AssemblyProgram.txt"
- Also, in file "examples.txt" I have write some examples so you can easily use.
- Arithmetic Operators
- +, -
- ++, --
- Relational Operators
- < , >
- <=, >=
- ==, !=
- Logical Operators
- &&
- ||
- !
- Bitwise Operators
- ^
- ~
- Misc Operators
- ()?
- Loops
- FOR: for( ; ; ), for( ; ; ){}
- WHILE: while(), while(){}
- DO WHILE: do{}while();
- Conditional Statements
- IF: if(), if(){}
- IF ELSE: if() else, if(){}else{}, if(){}else, if()else{}
- For example:
a=5;
a=a+10;
b=0;
b+=a;
while(b){
d=10;
b--;
}
for(a;a>10;a--)
while(d)
d--;