Amat Gil

Simulador SISA

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.

Usage

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]

IO

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).

Registers

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).

Ideas

Notes

License

Licensed under the GPLv3 (see COPYING file for full text).