From 427ee519db76b7a0747b5fc1d5dcf97092b5c0bf Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 7 Apr 2011 15:14:12 -0300 Subject: new instruction OP_LOADKX (to replace OP_LOADK with extra argument) --- lopcodes.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lopcodes.h') diff --git a/lopcodes.h b/lopcodes.h index 9009b382..60d1492d 100644 --- a/lopcodes.h +++ b/lopcodes.h @@ -1,5 +1,5 @@ /* -** $Id: lopcodes.h,v 1.138 2011/02/01 18:03:10 roberto Exp roberto $ +** $Id: lopcodes.h,v 1.139 2011/02/07 12:24:42 roberto Exp roberto $ ** Opcodes for Lua virtual machine ** See Copyright Notice in lua.h */ @@ -167,7 +167,8 @@ typedef enum { name args description ------------------------------------------------------------------------*/ OP_MOVE,/* A B R(A) := R(B) */ -OP_LOADK,/* A Bx R(A) := Kst(Bx - 1) */ +OP_LOADK,/* A Bx R(A) := Kst(Bx) */ +OP_LOADKX,/* A R(A) := Kst(extra arg) */ OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */ OP_GETUPVAL,/* A B R(A) := UpValue[B] */ @@ -242,7 +243,7 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ (*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next 'instruction' is EXTRAARG(real C). - (*) In OP_LOADK, if (Bx == 0) then next 'instruction' is EXTRAARG(real Bx). + (*) In OP_LOADKX, the next 'instruction' is always EXTRAARG. (*) For comparisons, A specifies what condition the test should accept (true or false). -- cgit v1.2.3-55-g6feb