Nand2Tetris Hack Computer
Tutorial (Video link coming soon)
- Just click START, Pong is preloaded! If your computer starts to chug set a higher [Cycles per frame] and lower FPS (see below). If you want to run your own program see below.
- Load the Hack Computer Binary file (.hack) at the bottom of the page.
- The binary will load automatically into the simulator. If you modify the binary from within the page click the 'Load in ROM' button to re-flash the ROM.
- [Optional] Adjust settings: (default values are for the pong.hack program)
- Number of setup cycles: describes how many cpu cycles are run before refreshing the screen for the first time. If set to zero the processor directly starts the screen refresh loop (see below).
- Cycles per frame: describes how many cpu cycles are run before rendering each frame.
- FPS: describes how many frames are rendered each second. If FPS==0, then only the setup cycles are performed. Execution can be advanced with the 'Cycle' or 'Frame' buttons.
- Ram write process: used for some programs (id est rect.hack or add.hack) that require some values in RAM before the execution to work.
- CLICK 'WRITE'
- A (rough) estimate of the processor frequency is given by [Cycles per frame]*[FPS]. This does not take into consideration JS overheads.
- CLICK 'START'
- While running:
- The keyboard is automatically routed to the KBD register at any moment.
- STOP: stops the executions, reset the PC and wipes RAM.
- Reset: just resets the PC.
- Cycle: advances the cpu by one cycle without refreshing the screen. Better only use when FPS==0.
- Frame: advances the cpu by [Cycles per frame] cycles and refreshes the screen once.
- Manual Refresh: refreshes the screen once.
- Colors of pixel can be changed!
- Have fun! Write me at firstname.lastname@example.org for any question or suggestion, or directly contribute to the project with code or bug reports, it is all open source!
Cycles per frame: