Translating Virtual Machine Code
Weighting and Due Dates
Marks for this assignment contribute 10% of the overall course mark.
Marks for functionality will be awarded automatically by the web submission system.
Late penalties: For each part, the maximum mark awarded will be reduced by 25% per day / part day late. If your mark is greater than the
maximum, it will be reduced to the maximum.
Core Body of Knowledge (CBOK) Areas: abstraction, design, hardware and software, data and information, and programming.
Project Description
In this assignment you will complete a variation of projects 7 and 8 in the nand2tetris course. In this assignment the translation program is in two
separate programs. The precompiled executable program, bin/parser, will read a Hack Virtual Machine file from standard input and produce an abstract
syntax tree on standard output. The executable program, translator, which you will write, will read the abstract syntax tree and output a Hack Assembly
Language translation of each Virtual Machine command. The output will be in a form suitable for testing by the precompiled executable
program bin/simulator.
SVN Repository
You must create a directory in your svn repository named: <year>/<semester>/cs/assignment2. This directory must only contain the following files and
directories - the web submission system (https://cs.adelaide.edu.au/services/websubmission) will check this:
Makefile - this file is used by make to compile your programs - do not modify this file.
Makefile-extras - this file is included by Makefile - do not modify this file.
translator.cpp - C++ source file
bin - this directory contains precompiled programs and scripts - do not modify this directory.
lib - this directory contains precompiled components - do not modify this directory.
includes - this directory contains .h files for precompiled classes - do not modify this directory.
tests - this directory contains test data, you can add your own tests here
Note: if the lib/lib.a file does not get added to your svn repository you will need to explicitly add it using:
% svn add lib/lib.a
Submission and Marking Scheme
This assignment has two assignments in the web submission system (https://cs.adelaide.edu.au/services/websubmission) named: Assignment 2 -
Milestone Submissions and Assignment 2 - Final Submissions. The assessment is based on "Assessment of Programming Assignments
(https://myuni.adelaide.edu.au/courses/44936/pages/assessment-of-programming-assignments) ". A submission to either assignment in the web
submission system (https://cs.adelaide.edu.au/services/websubmission) will automatically result in a submission to the other assignment.