Improve error messaging

This commit is contained in:
2025-12-23 09:51:09 +01:00
parent 976bd688b0
commit 1b409cd14e

View File

@@ -49,12 +49,13 @@ impl Core {
Ok(i) => i, Ok(i) => i,
Err(_) => { Err(_) => {
eprintln!("Memory access fault while fetching instruction"); eprintln!("Memory access fault while fetching instruction");
eprintln!("PC: {:x}", self.pc);
break; break;
} }
}; };
if instr == 0 { if instr == 0 {
eprintln!("Executing 0 instruction at {:X}", self.pc); eprintln!("Executing 0 instruction at {:x}", self.pc);
break; break;
} }
@@ -69,7 +70,7 @@ impl Core {
InstructionResult::Normal => {} InstructionResult::Normal => {}
InstructionResult::Exception(_e) => { InstructionResult::Exception(_e) => {
eprintln!("Exception from instruction"); eprintln!("Exception from instruction");
eprintln!("PC: {:016X}, instr: {:08X}", self.pc, instr.0); eprintln!("PC: {:016x}, instr: {:08x}", self.pc, instr.0);
break; break;
} }
InstructionResult::Pause => { InstructionResult::Pause => {