diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-03 11:51:39 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-03 11:51:39 +0100 |
commit | 29975e1ce839098e7e55b0cd25d788f0c96555ba (patch) | |
tree | 81b2e984240fcbc47422cd00bc6696cfd91b20b8 /src/lvm.js | |
parent | 3e7c7039680f80f3fa90cf357e5448d42397ea16 (diff) | |
download | fengari-29975e1ce839098e7e55b0cd25d788f0c96555ba.tar.gz fengari-29975e1ce839098e7e55b0cd25d788f0c96555ba.tar.bz2 fengari-29975e1ce839098e7e55b0cd25d788f0c96555ba.zip |
MOVE
Diffstat (limited to 'src/lvm.js')
-rw-r--r-- | src/lvm.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -42,11 +42,10 @@ class LuaVM { let i = ci.savedpc[ci.pcOff++]; let ra = this.RA(base, i.A); - - console.log(OC.OpCodes[i.opcode]); + switch (OC.OpCodes[i.opcode]) { case "OP_MOVE": - L.stack[ra] = RB(base, i.opcode, i.B); + L.stack[ra] = L.stack[this.RB(base, i.opcode, i.B)]; break; case "OP_LOADK": L.stack[ra] = k[i.Bx]; @@ -131,6 +130,8 @@ class LuaVM { } L.ci = ci.previous; + // TODO what to return when end of program ? + console.log(L.stack); if (L.ci === null) return; if (i.B !== 0) L.top = ci.top; |