1 unstable release
0.2.0 | Mar 30, 2021 |
---|
#15 in #assemble
84KB
2K
SLoC
Rano
Bins
ra
An assembler for the Mano Machine.
# You can assemble a program like this:
cargo run --bin ra -- -r MAIN tests/example.mano
# ...
xxd tests/example.hex
# Or like
cargo install rano
# and then
ra -r MAIN tests/example.mano -o example.hex
# ...
xxd example.hex
to get more information on the specific options afforded run ra --help
.
Build modes
ra supports two build modes: debug and release. By default debug is selected. This type of build includes extra information which the emulator can use to help you debug your code. The release build strips these debug symbols, and is thus much smaller. You can select between them like so:
# For a debug build
ra -r MAIN tests/example.mano
# For a release build
ra -r MAIN --release tests/example.mano
rano
This has not yet been completed, but will be a Mano Machine Emulator.
lib.rs
:
Assemble and run programs for the Mano Machine
// It would generally be reccommended that you read this in from a file
let program =
"VAR1, HEX 0100 \nVAR2, HEX 0010 \nMAIN, LDA VAR1 \nADD VAR2 \nSTA VAR2 \nHLT \n";
let bin = match
ass::debug_build(&program, ResetVector::Label("MAIN".to_string())) {
Ok(b) => b,
// Gives you useful error messages
Err(e) => {
println!("{}", e);
exit(-1)
},
};
Dependencies
~6–14MB
~167K SLoC