# HG changeset patch # User Matthew Wild # Date 1290374724 0 # Node ID 6a6e5ef39eaf31c44e0da9ad4968da359935bbe3 # Parent db4b13efbd50dba9d07fcd27b0daf2a670ffb356 Implement OP_MUL (no metamethod yet) diff -r db4b13efbd50 -r 6a6e5ef39eaf lvm.js --- a/lvm.js Sun Nov 21 21:17:59 2010 +0000 +++ b/lvm.js Sun Nov 21 21:25:24 2010 +0000 @@ -13,7 +13,7 @@ var OP_SELF = 11; var OP_ADD = 12; var OP_SUB = 13; -//var OP_MUL = 14; +var OP_MUL = 14; var OP_DIV = 15; //var OP_MOD = 16; //var OP_POW = 17; @@ -620,6 +620,11 @@ var RC = RK(frame, INS_C(instruction)); frame.reg[INS_A(instruction)] = new LValue(this, "number", RB.value - RC.value); break; + case OP_MUL: + var RB = RK(frame, INS_B(instruction)); + var RC = RK(frame, INS_C(instruction)); + frame.reg[INS_A(instruction)] = new LValue(this, "number", RB.value * RC.value); + break; case OP_DIV: var RB = RK(frame, INS_B(instruction)); var RC = RK(frame, INS_C(instruction));