The purpose of this project is to gain experience in giving meaning to a programming language by generating x86-64 for a subset of Cminus.

computer science

Description

Purpose 

The purpose of this project is to gain experience in giving meaning to a programming language by generating x86-64 for a subset of Cminus. Specifically, you will be generating assembly for if-statements, while-loops, and integer one-dimensional or two-dimensional arrays. Project Summary In this project, you will add grammar rules and actions to the compiler developed in the previous project that will do the following 

1. Add a grammar rule to accept declaration of a two-dimensional integer array 

2. Add a grammar rule to accept an reference to a two-dimensional integer array element 

3. Generate assembly to test the results of an expression controlling an if-statement or while-loop. 

4. Generate assembly to branch through an if-then-else statement as determined by the controlling expression 

5. Generate assembly to branch back to the beginning of and out of a while-loop as determined by the controlling expression. 6. Reserve space for an array of integers. 

7. Generate address arithmetic for an array reference. For array declarations, you only need to handle the following style:

Instruction Files

Related Questions in computer science category