/// <summary> /// R(A) -= R(A + 2) /// pc += sBx /// </summary> public static void ForPrep(Instruction ins, ILuaVM vm) { ins.AsBx(out var a, out var sbx); a += 1; if (vm.Type(a) == ELuaType.String) { vm.PushNumber(vm.ToNumber(a)); vm.Replace(a); } if (vm.Type(a + 1) == ELuaType.String) { vm.PushNumber(vm.ToNumber(a + 1)); vm.Replace(a + 1); } if (vm.Type(a + 2) == ELuaType.String) { vm.PushNumber(vm.ToNumber(a + 2)); vm.Replace(a + 2); } // R(A) -= R(A + 2) vm.PushValue(a); vm.PushValue(a + 2); vm.Arith(EArithOp.Sub); vm.Replace(a); // pc += sBx vm.AddPC(sbx); }