Updated spec page
This commit is contained in:
parent
75465c6a20
commit
95272a3472
2 changed files with 9 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Iridium
|
||||
|
||||
Corten is based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial. His virtual machine used for the tutorial is known as [Iridium](https://github.com/fhaynes/iridium). Despite it's origins, it does aim to be full a fledged virtual machine and is already on it's [third iteration](https://gitlab.com/fletchercp/iridium3) with support for SSH, PIDs and Strings. Corten aims to be Iridium 1-compatible.
|
||||
Corten is based on Fletcher Haynes's [So you want to build a language VM](https://blog.subnetzero.io/post/building-language-vm-part-01/) tutorial. His virtual machine used for the tutorial is known as [Iridium](https://github.com/fhaynes/iridium) and is based on the [MIPS64 Release 6](https://en.wikipedia.org/wiki/MIPS_architecture#MIPS32/MIPS64_Release_6) architecture. Corten aims to be Iridium 1-compatible.
|
||||
|
||||
## Instruction Set
|
||||
|
||||
|
@ -21,8 +21,8 @@ Corten is based on Fletcher Haynes's [So you want to build a language VM](https:
|
|||
| 10 | NEQ | Not equal |
|
||||
| 11 | GTE | Greater then or equal to |
|
||||
| 12 | GT | Greater then |
|
||||
| 13 | LTE | Less then or equal |
|
||||
| 14 | LT | Less then
|
||||
| 13 | LTE | Less then or equal to |
|
||||
| 14 | LT | Less then |
|
||||
| 15 | JMPE | Jump if equal |
|
||||
| 16 | NOP |
|
||||
| _ | IGL | Illegal action |
|
14
src/repl.rs
14
src/repl.rs
|
@ -1,7 +1,7 @@
|
|||
use std;
|
||||
use std::io;
|
||||
use std::num::ParseIntError;
|
||||
use std::io::Write;
|
||||
use std::num::ParseIntError;
|
||||
|
||||
use crate::vm::VM;
|
||||
use metacrate::crate_version;
|
||||
|
@ -59,7 +59,7 @@ impl REPL {
|
|||
match buffer {
|
||||
".exit" => {
|
||||
std::process::exit(0);
|
||||
},
|
||||
}
|
||||
".history" => {
|
||||
for command in &self.command_buffer {
|
||||
println!("{}", command);
|
||||
|
@ -70,11 +70,11 @@ impl REPL {
|
|||
for instruction in &self.vm.program {
|
||||
println!("{}", instruction);
|
||||
}
|
||||
},
|
||||
}
|
||||
".registers" => {
|
||||
println!("Listing registers and all contents:");
|
||||
println!("{:#?}", self.vm.registers);
|
||||
},
|
||||
}
|
||||
_ => {
|
||||
let results = self.parse_hex(buffer);
|
||||
match results {
|
||||
|
@ -103,12 +103,10 @@ impl REPL {
|
|||
match byte {
|
||||
Ok(result) => {
|
||||
results.push(result);
|
||||
},
|
||||
Err(err) => {
|
||||
return Err(err)
|
||||
}
|
||||
Err(err) => return Err(err),
|
||||
}
|
||||
}
|
||||
Ok(results)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue