diff options
Diffstat (limited to 'src/vm/core.js')
-rw-r--r-- | src/vm/core.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vm/core.js b/src/vm/core.js index 074e156..6303ee5 100644 --- a/src/vm/core.js +++ b/src/vm/core.js @@ -31,13 +31,13 @@ class Core { return this.normalize(pc, address.value); case AddrMode.Indirect: { let loc = this.normalize(pc, address.value); - let b = this.data[loc]; + let b = this.data[loc].b.value; return this.normalize(loc, b); } case AddrMode.Predecrement: { let loc = this.normalize(pc, address.value); - this.data[loc].b -= 1; - let b = this.data[loc].b; + this.data[loc].b.value -= 1; + let b = this.data[loc].b.value; return this.normalize(loc, b); } default: @@ -46,7 +46,8 @@ class Core { } getValue(pc, address) { - return this.data[this.getLocation(pc, address)]; + const index = this.getLocation(pc, address); + return this.data[index]; } } |