summary refs log tree commit diff
path: root/65c02.ts
diff options
context:
space:
mode:
Diffstat (limited to '65c02.ts')
-rw-r--r--65c02.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/65c02.ts b/65c02.ts
index 9d286d9..f1368a9 100644
--- a/65c02.ts
+++ b/65c02.ts
@@ -288,7 +288,7 @@ export default class The65c02 {
                 this.programCounter.increment()
                 const neg = offset.bit(7);
                 offset.setBit(7, false)
-                return this.programCounter.num() + (offset.num() * (neg ? -1 : 1))
+                return this.programCounter.num() + (offset.num() + (neg ? -128 : 0))
             case 'zero-page':
                 return this.getZPAddr()
             case 'zero-page, X-indexed':