diff --git a/simu/src/main.rs b/simu/src/main.rs index b927e93..21f351d 100644 --- a/simu/src/main.rs +++ b/simu/src/main.rs @@ -399,14 +399,14 @@ fn debug_loop(com: &mut Computer) { Commands::Run { desigantor } => match desigantor { Some(s) => match parse_int::parse::(s.as_str()) { Ok(addr) => { - while com.pc != (addr / 4) { + while com.pc != (addr / 4) && !com.error { com.debug_step(1); } debug_context(com); } Err(_) => match com.book.1.get(s.as_str()).cloned() { Some(addr) => { - while com.pc != (addr as usize / 4) { + while com.pc != (addr as usize / 4) && !com.error { com.debug_step(1); } debug_context(com); @@ -425,9 +425,9 @@ fn debug_loop(com: &mut Computer) { }, Commands::Up => { let curr_sp = com.sp; - while (com.sp < curr_sp) - || ((com.ram[com.pc] != (0b10001000 << 24)) - && (com.ram[com.pc] != (0b10101000 << 24))) + while (com.sp < curr_sp + || (com.ram[com.pc] != (0b10001000 << 24) && com.ram[com.pc] != (0b10101000 << 24))) + && !com.error { com.debug_step(1); }