This is the moment we have been working like mad for all semester to get to! The moment of truth. We build the compiler! You've got this! I have selected 200+ test files that will be compiled using your compiler. The compile compiles a program of the form xxx.c- to a TM file called xxx.tm. The compile statement is generally:

c- testfile.c-
which will create a testfile.tm. The tm program can then be used to load and run the code:
tm testfile.tm
We will be using TM v4.6 or later for this assignment! A description of the tm machine is described here including the commands for use of the tm, instruction set, idioms, examples of segments of code for specific purposes: tmDescription.pdf

IMPORTANT: grading is dependent on the output of running the program you have compiled. I will not be testing that your tm code is correct. It will test that the tm code generated by your compiler runs correctly. The test data files include an script called runTests that is similar to what is run on the actual test machine.

You have hundreds of examples of compiled code. For debugging purposes you might want to look at the Unit tests to focus in on specific functionality. Each file will be compiled with your compiler and the resulting tm code will be run on TM v4.6a. The output of the TM run will be compared to the expected output. If it passes the test an "Output OK" will be given. If not, the difference will be printed in the standard side by side way. See the script runTests in the testData file for an approximate example you can use for testing on your unix machine. It is that simple. The more OK's you get, the better your grade. As always, seg faults/failure build your compiler/failure to compile the c- code, load or run will really hurt your grade.

You may use emitcode.cpp and emitcode.h to emit tm instructions. The current version of the tm machine is tm.c and is an extension of the tm from the book. Here is the manual for the tiny machine: tmDescription.pdf. Be sure to download the latest and to get any bug fixes.

An example of the I/O Library that belongs at the beginning of the code is provided. The I/O library can also be seen at the beginning of all the code examples. The I/O Library routines are each in a kind of iconical format, but you can code them more "tightly" if you choose. What matters is the output of your compiled code when run on TM.

Like all real world projects you start with grand ambitions embodied in a list of features you hope to implement. As with real projects, as we approach the release deadline, features must be put on the chopping block to meet the deadline. So it is with our project. While we must continue to support the full language for the memory assignment A6. However, we may trim features for A7 code generation to meet our deadline. Please watch the class news should I decide to pull any features. Start with the basics in the order we discussed in class and you will be fine.

To make a reduced C- happen, the tests will have the removed features removed from the test suite programs. Let me know if you find a file where I haven't. You will still have to do function calls, arrays, while, global and local variables, parameter passing of arrays, etc.