summaryrefslogtreecommitdiff
path: root/src/vm/core.js
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-05-23 12:43:07 -0500
committersanine-a <sanine.not@pm.me>2023-05-23 12:43:07 -0500
commitc7f8ede9223502a96a74adf0cb790ac41de04742 (patch)
treece4e142946bf78bec033d231afd0bdebb7af087c /src/vm/core.js
parent4d5377870ee554036ac9aab570ac2bc809fc88bd (diff)
correct indirection code to match spec
Diffstat (limited to 'src/vm/core.js')
-rw-r--r--src/vm/core.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/core.js b/src/vm/core.js
index 9b0fe77..4fdd0a0 100644
--- a/src/vm/core.js
+++ b/src/vm/core.js
@@ -37,13 +37,13 @@ class Core {
case AddrMode.Indirect: {
let loc = this.normalize(pc, address.value);
let b = this.data[loc].b.value;
- return this.normalize(loc, b);
+ return this.normalize(pc, b);
}
case AddrMode.Predecrement: {
let loc = this.normalize(pc, address.value);
this.data[loc].b.value -= 1;
let b = this.data[loc].b.value;
- return this.normalize(loc, b);
+ return this.normalize(pc, b);
}
default:
throw `Invalid addressing mode "${address.mode}"`;