From e6c41303c2da5afd230570cb5610905ade71fecf Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 24 Aug 2026 16:18:27 +0200 Subject: runrom: add the --until-address option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows the user to run execution until a given address is reached. This can, like with the --start option, be coupled with the --nasm option in order to be able to provide an identifier instead of a regular hexadecimal value. Signed-off-by: Miquel Sabaté Solà --- lib/vnf/src/lib.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'lib/vnf/src') diff --git a/lib/vnf/src/lib.rs b/lib/vnf/src/lib.rs index d118157..349548a 100644 --- a/lib/vnf/src/lib.rs +++ b/lib/vnf/src/lib.rs @@ -183,7 +183,7 @@ pub struct Machine { /// Whether the machine is supposed to be running just a function (while /// also going into inner calls). Hence, it will stop whenever an 'rts' or /// 'rti' instruction is found at the top level. - run_function_mode: bool, + pub run_function_mode: bool, /// The PRG ROM pool of bytes. pub prg_rom: Vec, @@ -554,20 +554,6 @@ impl Machine { Ok(()) } - /// Run a top-level function. That is, assume that the current 'start' - /// address is the start of a function, and keep on iterating the machine - /// until an 'rts'/'rti' instruction is found at the top-level (we still - /// allow inner calls). - pub fn run_function(&mut self) -> Result<(), String> { - self.run_function_mode = true; - - while self.active { - self.next_iteration()?; - } - - Ok(()) - } - /// Run until the program counter reaches the given 'address'. pub fn until_address(&mut self, address: u16) -> Result<(), String> { while self.pc != address as usize { -- cgit v1.2.3