Portugal
Computer Science student mostly interested in programming languages, theorem proving/logical systems, concurrent systems and back-end web development. Beep boop
From João Pedro Leite to ~tmpod/toasty-lc3-vm
I snipped some of the diff's content that was also in the PATCH's first version, and that probably screwed it up. There's a way to that correctly, right? Or should I just send the entire diff so that it shows up in each new version of the patch, for context's sake?
From jpl to ~tmpod/toasty-lc3-vm
Still need to add debugging in instruction execution, and perhaps add a better VM constructor for debugging, that can still allow for toggling the debug mode in the middle of execution. Later on, swapping over printing to stderr to logging with and without debugging would probably be more suitable. --- Alright, got that fixed. We're probably going to want to switch to logging instead of stderr printing, but
From jpl to ~tmpod/toasty-lc3-vm
Still need to add debugging in instruction
execution, and perhaps add a better VM
constructor for debugging, that can still
allow for toggling the debug mode in the
middle of execution.
---
Debugging inside the CPU would involve passing around the debug flag
and the stderr lock into the CPU module, which seems simple enough,
but might get unhandy, especially since StderrLock has an associated
lifetime, which might propagate some complexity.
I'm not sure if there's a better way of handling it as of now,
but if you've got any debug design you'd rather implement, I'm all
[message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- src/ir.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/ir.rs b/src/ir.rs index 4ae3518..6c49f73 100644 --- a/src/ir.rs +++ b/src/ir.rs @@ -57,11 +57,6 @@ impl BrainfuckIR { } }; // Tiny optimization I suppose if let Some(BrainfuckInstruction::INP) = instructions.last() {[message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- primitives/src/instructions.rs | 86 ++++++++++++++++++++++++++++++++-- vm/src/cpu.rs | 17 +++++++ 2 files changed, 100 insertions(+), 3 deletions(-) diff --git a/primitives/src/instructions.rs b/primitives/src/instructions.rs index 31651d3..b4c677a 100644 --- a/primitives/src/instructions.rs +++ b/primitives/src/instructions.rs @@ -7,36 +7,88 @@ use crate::utils::sign_extend; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Instruction { // Conditional branch[message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- src/ir.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ir.rs b/src/ir.rs index 4ae3518..3ee6ad8 100644 --- a/src/ir.rs +++ b/src/ir.rs @@ -57,10 +57,10 @@ impl BrainfuckIR { } }; // Tiny optimization I suppose if let Some(BrainfuckInstruction::INP) = instructions.last() {[message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- vm/src/cpu.rs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/vm/src/cpu.rs b/vm/src/cpu.rs index 2fb8310..68cb32b 100644 --- a/vm/src/cpu.rs +++ b/vm/src/cpu.rs @@ -43,12 +43,19 @@ impl CPU { instruction: Instruction, ) -> Result<()> { match instruction { // Branch // Offsets the Program Counter (PC) by the given offset[message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- primitives/src/instructions.rs | 10 +++++----- primitives/src/registers.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/primitives/src/instructions.rs b/primitives/src/instructions.rs index cc39b55..3d08f21 100644 --- a/primitives/src/instructions.rs +++ b/primitives/src/instructions.rs @@ -5,7 +5,7 @@ use crate::registers::Register; use crate::types::Word; use crate::utils::sign_extend; #[derive(Debug)][message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- Cargo.lock | 215 +++++++++++++++++++++++++++++++++++++++++++++------- Cargo.toml | 1 + src/main.rs | 19 +++-- 3 files changed, 204 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e711c6..fc932da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 [message trimmed]
From jpl to ~tmpod/toasty-lc3-vm
--- Cargo.lock | 215 +++++++++++++++++++++++++++++++++++++++++++++------- Cargo.toml | 1 + src/main.rs | 18 ++++- 3 files changed, 204 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e711c6..4ad9b98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,17 @@ # It is not intended for manual editing. version = 3 [message trimmed]