A simple two-pass assembler for the HACK CPU's assembly language, written in Flex/Bison (Project 6 of Nand2Tetris). Supports predefined symbols (KBD, R0-R15 etc.), labels and variables as well. Know more about the HACK assembly language here
You need to have make, flex and bison installed on your machine. In case you don't, run the following command to install them.
sudo apt install flex bison build-essential
sudo pacman -S base-devel
Run the following commands to clone and build HASM
git clone https://github.com/abcdjdj/hasm
cd hasm
make
./hasm.out <asm file>
By default, the generated binary code will get printed to stdout