Skip to content

Commit f57b974

Browse files
committed
Initial commit
0 parents  commit f57b974

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Leo Cassarani
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# hack-js
2+
3+
hack-js is a JavaScript implementation of the computer architecture from
4+
the book "Elements of Computing Systems", which accompanies the [NAND to
5+
Tetris course](http://www.nand2tetris.org).
6+
7+
hack-js uses a web browser to run .hack files containing machine code
8+
instructions. An HTML5 canvas is used to display operations that draw
9+
to the screen, and relevant keyboard events are forwarded to the Hack
10+
program.
11+
12+
hack-js is a work in progress, and was inspired by the [London
13+
Computation Club](http://london.computation.club) meet-up.
14+
15+
## Installing
16+
17+
The only dependency is Node.js. No third-party libraries required.
18+
19+
## Running
20+
21+
Use the `bin/run` binary to run a given Hack file. For example:
22+
23+
```
24+
$ bin/run Pong.asm
25+
Running Pong.asm at http://0.0.0.0:4225
26+
```
27+
28+
This will launch a local web server on port 4225 ("HACK" on a phone
29+
keypad). Navigating to http://0.0.0.0:4225 in a reasonably recent
30+
browser will run the Hack program and display its output in a 256x512
31+
HTML5 canvas element.

0 commit comments

Comments
 (0)