There was an error while loading. Please reload this page.
1 parent bb13a4a commit bc2d256Copy full SHA for bc2d256
Processor.ts
@@ -381,6 +381,7 @@ export class Processor {
381
const v1 = this.registers[A];
382
const v2 = getAddress ? this.readMem(getAddress(operand)) : operand;
383
//sbc should be the same operation as adc but with the bits of the memory byte flipped
384
+ //>>> coerces to an unsigned int so that the bitwise invert ~ works as expected, otherwise in JS ~0xff == -255
385
const sum = this.internaladc(v1, (~v2 >>> 0) & 0xff);
386
this.registers[A] = sum;
387
}
test/.gitignore
@@ -0,0 +1 @@
1
+6502_functional_test.bin
0 commit comments