How ksbharadwaj148-wq/hack_assembly works
Hack_assembler converts Hack assembly text into binary machine-code files. The workflow starts with a user supplying an .asm path, then the CLI reads it, the assembler parses commands in two passes, resolves labels and variables through a symbol table, encodes instructions, and writes the .hack result. The README describes this conversion; the graph focuses on the inspected runtime modules and their evidenced calls.
Main entry points: assembler.py Two-pass assembler · parser.py Command parser · symbol_table.py Symbol table · code.py Mnemonic encoder
Components 7
Assembly conversion
- CLI entry
assembler.py - Two-pass assembler
assembler.py - Command parser
parser.py - Symbol table
symbol_table.py
Instruction encoding
- Mnemonic encoder
code.py
Other components
- Assembly user
- Hack output
Connections 6
- Assembly user → CLI entry: supplies ASM path
README.md - CLI entry → Two-pass assembler: invokes assembly
assembler.py - Two-pass assembler → Command parser: parses commands
assembler.py - Two-pass assembler → Symbol table: resolves symbols
assembler.py - Two-pass assembler → Mnemonic encoder: encodes mnemonics
assembler.py - Two-pass assembler → Hack output: writes machine code
assembler.py