Fix bug in addition
This commit is contained in:
parent
27a192bcdf
commit
890bb16145
|
|
@ -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;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue