aboutsummaryrefslogtreecommitdiffgithub
path: root/novice/simulator/debugger.ts
diff options
context:
space:
mode:
Diffstat (limited to 'novice/simulator/debugger.ts')
-rw-r--r--novice/simulator/debugger.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/novice/simulator/debugger.ts b/novice/simulator/debugger.ts
index 9932eec..ab79b48 100644
--- a/novice/simulator/debugger.ts
+++ b/novice/simulator/debugger.ts
@@ -135,7 +135,16 @@ class Debugger extends Simulator {
const word = this.load(pc);
const sext = sextTo(word, this.isa.mem.word);
const labels = this.labelsForAddr(pc);
- result.push([pc, word, sext, this.disassemble(pc, word), labels]);
+ let disassembled = this.disassemble(pc, word);
+
+ // If cannot disassemble and a printable ascii character,
+ // stick that bad boy in there
+ if (!disassembled && ' '.charCodeAt(0) <= word &&
+ word <= '~'.charCodeAt(0)) {
+ disassembled = `'${String.fromCharCode(word)}'`;
+ }
+
+ result.push([pc, word, sext, disassembled, labels]);
}
return result;