CSCI 322 - Computing Systems Organization

Spring 2020

Project 11 Guide

To complete Project 11, it is best to finish the compiler in stages. At each stage, only implement the code generation for the productions sufficient for completing the given test case.

Some of these test cases are included in the nand2tetris distribution. Others I created myself; their titles include hyperlinks to the ZIP files containing their source code in Jack.

Three

To compile Three, you need to generate code for the following symbols:

Seven

To compile Seven, you need to generate code for the following additional symbols:

AlphaWhere

To compile AlphaWhere, you need to generate code for the following additional symbols: Note : You will need to create a symbol table data structure to keep track of your local variables.

AlphaShow

To compile AlphaShow, you need to generate code for the following additional symbols:

Factorial

To compile Factorial, you need to generate code for the following additional symbols:

ConvertToBin

NOTE: The provided ConvertToBin is difficult to use. I recommend my modified version (Main.jack). My version uses keyboard input and prints to the screen, rather than relying on RAM hacking. Note that it prints its binary result with the least significant bit on the left (reversed in comparison to how you would typically write a binary number).

To compile ConvertToBin, you need to generate code for the following additional symbols:

Average

To compile Average, you need to generate code for the following additional symbols:

ComplexArrays

ComplexArray should compile if Average compiles. It is a much tougher test case, though. Make sure that the destination of the expression in a let statement does not have that inadvertently overwritten.

Square

To compile Square, the compiler should be completely finished, except for static variables. Pay particular attention to the following:

Pong

To compile Pong, the compiler should handle static class variables, unary -, and binary |.