Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nopey/ssbc-rs
An interpreter for the SSBC toy assembly language
https://github.com/nopey/ssbc-rs
assembly rust
Last synced: about 1 month ago
JSON representation
An interpreter for the SSBC toy assembly language
- Host: GitHub
- URL: https://github.com/nopey/ssbc-rs
- Owner: Nopey
- License: apache-2.0
- Created: 2020-10-05T02:38:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T00:06:24.000Z (over 4 years ago)
- Last Synced: 2024-12-30T17:23:45.282Z (about 1 month ago)
- Topics: assembly, rust
- Language: Rust
- Homepage: http://csci.viu.ca/~pwalsh/teaching/261/261/261.html
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# SSBC-rs
An interpreter for the SSBC.For more information on the SSBC, see [Peter Walsh's Computer Architecture course](http://csci.viu.ca/~pwalsh/teaching/261/261/261.html),
or [a past student's online interpreter written in JavaScript](https://babakanoosh.github.io/Visual-SSBC/index.html).## Differences
The SSBC has a different subtract instruction, depending on whether you're in CSCI 261 or CSCI 355,
See the Signed Mode section of this document for instructions on how to set the mode.Telling ssbc.pl to run without first resetting enters an infinite loop, with no side affects.
Telling ssbc-rs to run without first resetting begins interpreting, which will likely NOP, unless there's been something written to ports B or DSituations where multiple reads and/or writes are happening to the same location within an instruction may behave differently than ssbc.pl (untested).
Register overflow (stack pointer, program counter) wrap, whereas ssbc.pl likely crashes with an array index out of bounds error (untested).
## Compiling
On otter, run `./build.sh`
Elsewhere, I recommend using cargo: `cargo build`### Signed Mode
By default, ssbc-rs uses two's complement subtraction, as the CSCI 355 SSBC does.If you'd like to match the 261 SSBC's behaviour,
pass `--cfg 'feature="signedmagnitude_sub"'` to build.sh when building on otter
or pass `--features=signedmagnitude_sub` when you're elsewhere.## Usage
Use the ssbc-rs binary as you would `ssbc.pl`.
If you'd like to run the SSBC's tests on ssbc-rs, you can modify `.batch_test` to run the ssbc-rs binary instead of `ssbc.pl`.## License
Licensed under either of* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.