https://github.com/fredmorcos/has
HAS
is MIT licensed (see the LICENSE
file) unless otherwise stated
at the top of a file.
The HACK Application Suite is a library and a program for handling various tasks related to the HACK CPU and instruction set as well as the JACK programming language. HAS currently consists of the following:
- HACK assembler
- HACK disassembler
- HACK interpreter
- HACK CPU emulator
- JACK virtual machine
- JACK compiler
HAS
makes use of subcommands.
cargo run -- --help
or has --help
:
has 0.3.0
The HACK Application Suite
USAGE:
has [FLAGS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-v, --verbose Verbose output (can be specified multiple times)
SUBCOMMANDS:
asm Assemble a HACK file
dis Disassemble a HACK file
help Prints this message or the help of the given subcommand(s)
The assembler can only build a single file at a time. The output file must not already exist.
has asm --help
:
has-asm 0.3.0
Assemble a HACK file
USAGE:
has asm [FLAGS] <FILE> --out <OUT>
FLAGS:
-b, --bintext Output a bintext instead of binary file
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-o, --out <OUT> Output file (must not exist)
ARGS:
<FILE> Hack assembly file to compile
The disassembler can only disassemble a single file at a time. The output file must not already exist.
has dis --help
:
has-dis 0.3.0
Disassemble a HACK file
USAGE:
has dis [FLAGS] <FILE> --out <OUT>
FLAGS:
-b, --bintext The input is a bintext instead of a binary file
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-o, --out <OUT> Output file (must not exist)
ARGS:
<FILE> Hack file to disassemble
Assemble a .asm
file with logging enabled: has -vvv asm infile.asm -o outfile.hack
Cargo can be used to install HAS
into ~/.cargo/bin
: cargo install --path .
To test the HAS
library, execute cargo test
in the top-level directory.