Improve the debug messages when invalid instructions are found

This commit is contained in:
2025-12-22 19:57:33 +01:00
parent bac68d7118
commit ae57cdc691

View File

@@ -53,6 +53,11 @@ impl Core {
} }
}; };
if instr == 0 {
eprintln!("Executing 0 instruction at {:X}", self.pc);
break;
}
assert_eq!(instr & 3, 3, "Compressed instructions not supported"); assert_eq!(instr & 3, 3, "Compressed instructions not supported");
let instr = Instruction(instr); let instr = Instruction(instr);
@@ -73,7 +78,7 @@ impl Core {
} }
} }
} else { } else {
eprintln!("Invalid Instruction 0x{:08x} 0b{:032b}", instr.0, instr.0); eprintln!("Invalid Instruction {:08x}", instr.0);
break; break;
} }
} }