Fix bug in addition

This commit is contained in:
n loewen 2023-07-25 18:57:35 +01:00
parent 27a192bcdf
commit 890bb16145
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ function CPU(mem) {
add_addr: (addr) => { add_addr: (addr) => {
console.log("ADD addr"); console.log("ADD addr");
if ( (this.acc + this.memory[addr]) > 15 ) { this.carryFlag = 1; } if ( (this.acc + this.memory[addr]) > 15 ) { this.carryFlag = 1; }
this.acc = (this.acc + this.memory[addr] % 15); this.acc = ((this.acc + this.memory[addr]) % 15);
this.instructionPointer = this.instructionPointer += 1; this.instructionPointer = this.instructionPointer += 1;
}, },