The code is incredibly self documenting (on purpose). Usage is below.
Options and flags can be shown by running the -h (summary) or --help (full) flags.
To solve the alien that I had for 13c (which gave instuctions and initial memory, with an initial
PC of 0 and no initial register state), use (Note the use of --simple):
cargo run -- --simple examples/alien/alien.sisa -m examples/alien/alien.smem -i examples/alien/alien.sio
To solve the alien that I had for Tema 14 (Note the lack of --simple):
cargo run -- examples/complete/first_example.sisa
You may also specify some initial values for the registers and IO, regardless of if the
input is --simple or not:
cargo run -- [code file] -r [registers file] -i [io file]
Use [cpu].update_io(new_io) to change the IO status in between executes. This cannot be done
from the cli, at the moment, because I have no idea how (and it doesn’t seem that useful, to be
honest).
File must contain eight lines (or less, for a computer with less registers), each with a decimal number. E.g.
0
0
0
0
0
0
5
17
Register 6 will hold 0x0005 and Register 7 will hold 0x0011.
You cannot use more than eight registers, it will abort (this is intended behavior).
as more (note the sign extension remarks when upcasting): https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions:, only labels are.set words like verbs, register names or labels. That’s UB.MOVI R5, 0x555.If you feed it invalid input, you’re gonna get UB (good luck
lmao), though I do try to catch them when I can.MAX_INSTRUCTION_RUN_SIZE), it halts execution.Licensed under the GPLv3 (see COPYING file for full text).