From 95272a3472e7801d09c2a8e59b0e3a581536a787 Mon Sep 17 00:00:00 2001 From: Anthony Foxclaw <35226681+tonytins@users.noreply.github.com> Date: Fri, 7 Feb 2020 02:17:59 -0500 Subject: [PATCH] Updated spec page --- docs/spec.md | 6 +++--- src/repl.rs | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/spec.md b/docs/spec.md index 41789bb..3f62c7d 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -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 | \ No newline at end of file diff --git a/src/repl.rs b/src/repl.rs index b85c0c6..1de1668 100644 --- a/src/repl.rs +++ b/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) } -} \ No newline at end of file +}