This is the Assembler for nand2teris project 6. It is written in Node.js with functional programming paradigm.
First put your source code in input
directory.
Let's say we have a test.asm
in input
directory
Second run this:
$ node src/index.js test.asm
Finally, check out output
directory for machine code (test.hack
)
This module is the entry point of the Assembler and its purpose is handling side effects:
- Reading source code from file
- Writing compiled machine code to file
Dependencies:
- Compile module for compilation
This module controls the flow of compilation process.
Dependencies:
- Parse module for parsing source code to token
- Generate Code module for transform token to machine code
- Symbols module for constructing symbol map.
This module parses source code into tokens.
This module transforms tokens into machine code
This module construct symbol map from source code