cpu - Fix: Include '$' before hex in debug-peeking for indirect ops

This commit is contained in:
n loewen 2023-08-29 21:25:59 -04:00
parent 1fe582663b
commit eff9043665
1 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ module.exports = class CPU {
}, },
store_addr: (addr) => { store_addr: (addr) => {
this.dbg.currentMnemonic = `STO addr; @addr: ${num2hex(this.memory[addr])}`; this.dbg.currentMnemonic = `STO addr; @addr: $${num2hex(this.memory[addr])}`;
this.memory[this.memory[addr]] = this.acc; this.memory[this.memory[addr]] = this.acc;
this._incrementIP(2); this._incrementIP(2);
}, },
@ -143,7 +143,7 @@ module.exports = class CPU {
}, },
load_addr: (addr) => { load_addr: (addr) => {
this.dbg.currentMnemonic = `LDA addr; @ addr: ${num2hex(this.memory[addr])}`; this.dbg.currentMnemonic = `LDA addr; @ addr: $${num2hex(this.memory[addr])}`;
this.acc = this.memory[addr]; this.acc = this.memory[addr];
this._updateFlagNegative(); this._updateFlagNegative();
this._updateFlagZero(); this._updateFlagZero();
@ -263,7 +263,7 @@ module.exports = class CPU {
}, },
hop_lit: (lit) => { hop_lit: (lit) => {
this.dbg.currentMnemonic = `HOP lit; IP+2: ${this.memory[this.IP+2]}, IP+3: ${this.memory[this.IP+3]}`; this.dbg.currentMnemonic = `HOP lit; IP+2: $${this.memory[this.IP+2]}, IP+3: $${this.memory[this.IP+3]}`;
if (this.acc === lit) { if (this.acc === lit) {
this._incrementIP(4); this._incrementIP(4);
} else { } else {