From f4791d1862be38988a2b16d06e450a3b6df0e7fb Mon Sep 17 00:00:00 2001 From: n loewen Date: Wed, 2 Aug 2023 14:07:30 +0100 Subject: [PATCH] Log CPU state in hex --- simulator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simulator.js b/simulator.js index 582a881..bf80c9a 100644 --- a/simulator.js +++ b/simulator.js @@ -198,6 +198,6 @@ exports.runProgram = async (code, debug = false) => { function logCPUState() { console.log(); - console.log( `IP: ${CPU.IP} Acc: ${CPU.Acc} CF: ${CPU.CF}  ${CPU.running ? "running" : "halted" }` ); + console.log( `IP: $${num2hex(CPU.IP)} Acc: $${num2hex(CPU.Acc)} CF: ${CPU.CF}  ${CPU.running ? "running" : "halted" }` ); console.log(); }; \ No newline at end of file