University of Arizona, Department of Computer Science

CSc 453 : Programming Assignment 4 (Code Generation)

Start Date: Mon April 11, 2016

Due Date: 11:59 PM, Tue April 26, 2016

1. General

This assignment involves generating assembly code for μC. The generated code should adhere to the operational semantics of μC.

The Target Architecture

The target architecture for this assignment will be the MIPS R2000 processor. Your compiler will generate assembly code for this processor; this assembly code will be executed using the SPIM simulator. (The code is free: it is available on lectura, and executables for PCs running MS-DOS and Microsoft Windows, together with documentation, are available from the SPIM homepage. However, note that SPIM inherits the endian-ness of the underlying processor, and this can cause it to give different results for the same program on different machines.)

Output Operations

These will be implemented using the function println() as for Milestone 1.

Supporting Documents

The following documents may be useful for this assignment:

2. Output

As before, your program will take its input from stdin and generate all output on stdout. Error messages, if any, will be sent to stderr. In case any errors are encountered during lexical or syntax analysis or during type checking, you should stop generating code, but continue to process the user program as best as possible.

The exit status of your program should be 0 if no errors are encountered during processing, and 1 if any errors are encountered at any point.

3. Turnin

You should turn in all the sources to all the phases of your compiler. You should also turn in a Makefile that supports at least the following targets:

To turn in your program, execute the command

turnin   cs453s16-assg4   file1 file2 ... filen
Turn in the files you want to submit just as they are: don't zip them up or turn in a directory containing your files.

4. Milestones

There is one intermediate milestone for this assignment, the spec for this is available here.