Emulator for the Hack CPU.
Emulator for the Hack CPU. (from nand2tetris)
https://abhaynayar.github.io/n2t-wasm/
Tested on Ubuntu 20.04 LTS.
Tools setup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install node
Clone this repository:
$ git clone https://github.com/abhaynayar/n2t-wasm
Build the emulator:
wasm-pack build
in the root directory. This will create a new pkg/ directory for the wasm modules.npm init wasm-app www
in the root directory. This will generate a web page in a new www/ directory.npm install
in www directory to install the node modules.npm run start
in the www
directory to start a local testing instance.npm run build
in the www
directory to publish the results to dist
.