Small refactor in exception handling in core.rs

This commit is contained in:
2025-12-24 16:14:54 +01:00
parent 44394b3d19
commit 6d9efb7eb8

View File

@@ -50,22 +50,20 @@ impl Core {
}
if instr & 3 != 3 {
// Compressed instruction - (currently) unsupported
self.throw_exception(ExceptionType::IllegalInstruction);
break;
}
let instr = Instruction(instr);
match find_and_exec(instr, self) {
Ok(()) => {}
Err(e) => {
if let Err(e) = find_and_exec(instr, self) {
self.throw_exception(e);
eprintln!("instr: {:08x}", instr.0);
break;
}
}
}
}
fn throw_exception(&mut self, exception_type: ExceptionType) {
eprintln!("Exception: {exception_type:?}");