From c7f8ede9223502a96a74adf0cb790ac41de04742 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 23 May 2023 12:43:07 -0500 Subject: correct indirection code to match spec --- src/vm/core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vm/core.js') 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}"`; -- cgit v1.2.1