https://github.com/nagariahussain/hackassembler
Python implementation of the nand2tetris' Hack Assembler Program
https://github.com/nagariahussain/hackassembler
Last synced: 7 months ago
JSON representation
Python implementation of the nand2tetris' Hack Assembler Program
- Host: GitHub
- URL: https://github.com/nagariahussain/hackassembler
- Owner: NagariaHussain
- Created: 2020-08-21T06:27:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T17:20:23.000Z (about 5 years ago)
- Last Synced: 2025-01-12T07:36:30.674Z (9 months ago)
- Language: Python
- Size: 49.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HackAssembler
Python implementation of the nand2tetris' Hack Assembler Program. Build for
project 6 of the nand2tetris course on coursera.## Goal
Develop an assembler that translates programs written in Hack assembly
language into the binary code understood by the Hack hardware platform.## Requirements
* Parse the Hack Assembly code file (*.asm)
* Handle whitespaces
* Handle comments:
1. Line comments
2. Inline comments
* Must be able to translate two types of instructions:
1. A-instruction
2. C-instruction
* Must be able to track symbols and labels
* Write the generated code into a file (*.hack)## Proposed API
* `Parser` module: Encapsulates access to the input code. Reads an assembly language command, parses it, and provides convenient access to the command’s components
(fields and symbols). In addition, removes all white space and comments.* `Code` module
* `Main` module
* Use a `HashTable` to handle symbols and labels## My Thoughts
1. This project is a good programming exercise.
2. I will use it to practice TDD and Unit Testing.
3. I will use `unittest` module of Python.## Contact
Feel free to contact me for queries:
Email: hussainbhaitech@gmail.com
Instagram: @NagariaHussain