Project 6 | |||||||||||||||||
In this part of the course you will have to read chapter 6 of the book (The Virtual Machine (a)), after reading the chapter you will have to read the following instructions to be able to implement project 6. Instructions: Objectives: Develop the Stack Arithmetic and Memory Access parts of the VM Translator, according to the specification and implementation notes in sections 6.2 and 6.3. The VM Translator should implement the Virtual Machine on the Hack computer platform. The contract: Write the VM Translator program. Use it to compile all the .vm test programs supplied below, yielding corresponding .asm programs written in assembly. When executed on the CPU Emulator, the .asm programs that your Translator produces should deliver the results mandated by the supplied test scripts and compare files. Implementation tips: The best way to implement the Translator is to start with a program that has limited capabilities, test it, and then extend it with additional capabilities. In particular, the implementation of your partial VM translator should be done in two stages:
For each stage, we supply test programs designed to test the specific functionality of the respective part of the VM Translator. In each one of the two stages, you should test your work as follows:
Important note: The test programs that we supply were carefully planned to test the specific features of each part. Therefore, it’s important to implement your VM translator in the proposed order, and to test it using the appropriate VM programs at each stage. Implementing a later stage before an early one may cause the test programs to fail.
Test Programs Stack Arithmetic:
Memory Access:
Pop
and Push operations, to and from various memory segments. Pop
and Push operations, to and from the static segment. Pop
and Push operations, using the pointer segment.
Steps: we recommend to proceed in the following order:
Resources
|
|||||||||||||||||