Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kerollmops/reustmann
Reustmann is a Von Neumann architecture
https://github.com/kerollmops/reustmann
interpreter rust von-neumann
Last synced: 3 months ago
JSON representation
Reustmann is a Von Neumann architecture
- Host: GitHub
- URL: https://github.com/kerollmops/reustmann
- Owner: Kerollmops
- Created: 2016-06-16T12:51:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-01-02T17:13:57.000Z (about 4 years ago)
- Last Synced: 2024-08-09T13:44:25.441Z (6 months ago)
- Topics: interpreter, rust, von-neumann
- Language: Rust
- Homepage: https://kerollmops.github.io/reustmann-doc/reustmann/reustmann
- Size: 106 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reustmann - a Von Neumann architecture
Reustmann is a Von Neumann architecture in Rust.
I was inspired by [the dave miller Iota machine](http://www.millermattson.com/dave/?p=174).I just recreate it in Rust.
The [Reustmann Documentation](https://docs.rs/reustmann).
## How to
The `hello_world.rm` program, make sure you don't add a final newline
```text
Gp..OOOOOOOOOOOOHTFello World!
```First create a program, from a file for example
```rust
extern crate reustmann;use std::fs::File;
use reustmann::Program;let program = Program::from_file("./hello_world.rm").unwrap();
```Then use this program to fill the interpreter memory
```rust
use reustmann::Interpreter;let arch_length = 50; // memory length
let arch_width = 8; // word sizelet mut interpreter = Interpreter::new(arch_length, arch_width).unwrap();
interpreter.copy_program(&program).unwrap();
```Then you can run it by using an interpreter
```rust
use reustmann::Statement;
use reustmann::instruction::op_codes;
use std::io::{empty, stdout};
// use std::io::sink; // for no outputlet mut input = empty(); // no input data needed
let mut output = stdout(); // output on the standard outputloop {
// each interpreter step return a statement
// while no `HALT` statement is found, we continue
match interpreter.step(&mut input, &mut output) {
Statement(op_codes::HALT, _) => break,
_ => ()
}
}
```You can have debug informations at any moment
```rust
// put this in the previous match, in the right position!
println!("{:?}", interpreter.debug_infos());
```