Skip to content

Commit 48c751a

Browse files
committed
Add abstract and future improvements
With minor rewords
1 parent 3d8d2d4 commit 48c751a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# NTU Introduction to Computer 2023 Fall Final Project - Assembler & VM Translator
22

3-
In this final project, I implemented projects 6 through 8 of the textbook, namely the Hack assembler and VM-to-Hack translator. I chose C++ as my programming language and opted for an object-oriented approach, not fully complying with the suggestions from the textbook.
3+
Author: B12902110 呂承諺 (100% contribution)
4+
5+
For the full commit history of the programs in this project, see [my main nand2tetris repository](https://github.com/gpwaob92679/nand2tetris).
6+
7+
## Abstract
8+
9+
In this final project, I implemented projects 6 through 8 of the textbook, namely the Hack assembler and VM-to-Hack translator. I chose C++ as my programming language and opted for an object-oriented design approach, not fully complying with the suggestions from the textbook.
410

511
I learned several software development tools through the process of doing this project. [CMake](https://cmake.org/), a cross-platform build system generator, is used to build this project, as it allows code to be compiled on various platforms with different compilers, and also simplifies testing and binary distribution. I chose [Abseil](https://github.com/abseil/abseil-cpp) as my support library, utilizing it's logging library, flags library and string utilities. For unit testing, [GoogleTest](https://github.com/google/googletest) is the framework of choice.
612

13+
Possible future improvements include:
14+
- Automated testing of the assembler
15+
- Produce better error and warning messages from the assembler and the VM translator
16+
- Optimize generated VM code (for example, when `index` is 0 or 1 for `push` and `pop` commands)
17+
718
## Assembler
819

920
assembler - An assembler for the Hack platform.
@@ -59,7 +70,7 @@ vmtranslator [-v] [-d] SOURCE
5970
- `-v`: Verbose output. Print translated assembly code to console.
6071
- `-d`: Debug mode. Write VM source lines as comments in assembly output.
6172

62-
If *`SOURCE`* is a single VM file (for example, `MyProgram.vm`), the translator will output the assembly file in the same directory as *`SOURCE`* (for example, `Program.asm`). If *`SOURCE`* is a directory (for example, `MyProgram`), the translator will gather and translate each VM file under the directory and output the assembly file under the directory (for example, `MyProgram/MyProgram.asm`).
73+
If *`SOURCE`* is a single VM file (for example, `MyProgram.vm`), the translator will output the assembly file in the same directory as *`SOURCE`* (for example, `Program.asm`). If *`SOURCE`* is a directory (for example, `MyProgram`), the translator will gather and translate each VM file in the directory and output the assembly file in the directory (for example, `MyProgram/MyProgram.asm`).
6374

6475
### Description
6576

@@ -79,7 +90,7 @@ The main program drives the entire translation using the other 3 modules. It has
7990

8091
- CMake 3.20 or later
8192
- A C++ compiler supporting at least C++17
82-
- A Java runtime environment that can run nand2tetris's CPU emulator (used in testing)
93+
- A Java runtime environment that can run nand2tetris's CPU emulator (used in a portion of tests)
8394

8495
#### Build
8596

0 commit comments

Comments
 (0)