cpu - Change debug printout formatting

This commit is contained in:
n loewen 2023-08-26 13:25:09 +01:00
parent d0b620f1ad
commit 41632b0a0f
1 changed files with 3 additions and 2 deletions

5
cpu.js
View File

@ -415,8 +415,9 @@ function logCPUState(debugInfo, debug = false, prettyPrintDisplay = false) {
}
console.log();
console.log(`Line ${debugInfo[CPU.previousIP].lineNumber}: ${debugInfo[CPU.previousIP].source}`);
console.log(' Mnemonic:', CPU.currentInstruction.mnemonic);
console.log(` Machine: $${num2hex(CPU.currentInstruction.opcode)} $${num2hex(CPU.currentInstruction.operand)}`);
console.log();
console.log('Mnemonic:', CPU.currentInstruction.mnemonic);
console.log(`Machine: $${num2hex(CPU.currentInstruction.opcode)} $${num2hex(CPU.currentInstruction.operand)}`);
console.log();
console.log(`IP: $${num2hex(CPU.IP)} Acc: $${num2hex(CPU.Acc)} ONZC: ${num2bin_4bit(CPU.FLAGS)}`);
console.log(`KEY: $${num2hex(CPU.memory[KEYPAD_ADDR])}  ${CPU.running ? "running" : "halted" }`);