summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortaitep <taitep@taitep.se>2025-12-22 19:57:33 +0100
committertaitep <taitep@taitep.se>2025-12-22 19:57:33 +0100
commitae57cdc69164b4426edc03564d32c0b8ecc72612 (patch)
treeb10324f133bed75c3e792a4884ee0df515e89705 /src
parentbac68d7118fdca1b06ad3349f7b6da9b89d0f63a (diff)
Improve the debug messages when invalid instructions are found
Diffstat (limited to 'src')
-rw-r--r--src/core.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core.rs b/src/core.rs
index 27ccf3f..2596441 100644
--- a/src/core.rs
+++ b/src/core.rs
@@ -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");
let instr = Instruction(instr);
@@ -73,7 +78,7 @@ impl Core {
}
}
} else {
- eprintln!("Invalid Instruction 0x{:08x} 0b{:032b}", instr.0, instr.0);
+ eprintln!("Invalid Instruction {:08x}", instr.0);
break;
}
}