From 233d928b6fd36e5ba12363cb8c6115c0b8e84906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Rativel?= Date: Mon, 21 Nov 2022 13:17:42 +0100 Subject: [PATCH] implemented run function to use one-instruction for several instruction --- src/machine.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index be92662..c71ccd2 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -37,6 +37,13 @@ impl Machine { } } + pub fn run(machine : Machine){ + let mut m = machine; + loop{ + Machine::one_instruction(&mut m); + } + } + pub fn one_instruction(machine :&mut Machine) { let mut unsigned_reg1 : u64 = 0;