Fix bug in addition
This commit is contained in:
parent
27a192bcdf
commit
890bb16145
|
|
@ -58,7 +58,7 @@ function CPU(mem) {
|
|||
add_addr: (addr) => {
|
||||
console.log("ADD addr");
|
||||
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;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue