diff options
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.128 2008/10/30 15:39:30 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.129 2009/03/09 15:27:56 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -166,15 +166,15 @@ typedef enum { | |||
166 | name args description | 166 | name args description |
167 | ------------------------------------------------------------------------*/ | 167 | ------------------------------------------------------------------------*/ |
168 | OP_MOVE,/* A B R(A) := R(B) */ | 168 | OP_MOVE,/* A B R(A) := R(B) */ |
169 | OP_LOADK,/* A Bx R(A) := Kst(Bx) */ | 169 | OP_LOADK,/* A Bx R(A) := Kst(Bx - 1) */ |
170 | OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ | 170 | OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ |
171 | OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */ | 171 | OP_LOADNIL,/* A B R(A) := ... := R(B) := nil */ |
172 | OP_GETUPVAL,/* A B R(A) := UpValue[B] */ | 172 | OP_GETUPVAL,/* A B R(A) := UpValue[B] */ |
173 | 173 | ||
174 | OP_GETGLOBAL,/* A Bx R(A) := Gbl[Kst(Bx)] */ | 174 | OP_GETGLOBAL,/* A Bx R(A) := Gbl[Kst(Bx - 1)] */ |
175 | OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */ | 175 | OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */ |
176 | 176 | ||
177 | OP_SETGLOBAL,/* A Bx Gbl[Kst(Bx)] := R(A) */ | 177 | OP_SETGLOBAL,/* A Bx Gbl[Kst(Bx - 1)] := R(A) */ |
178 | OP_SETUPVAL,/* A B UpValue[B] := R(A) */ | 178 | OP_SETUPVAL,/* A B UpValue[B] := R(A) */ |
179 | OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */ | 179 | OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */ |
180 | 180 | ||
@@ -221,7 +221,7 @@ OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ | |||
221 | 221 | ||
222 | OP_TFORLOOP,/* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }*/ | 222 | OP_TFORLOOP,/* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }*/ |
223 | 223 | ||
224 | OP_EXTRAARG/* Ax extra argument for previous opcode */ | 224 | OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ |
225 | } OpCode; | 225 | } OpCode; |
226 | 226 | ||
227 | 227 | ||
@@ -241,7 +241,10 @@ OP_EXTRAARG/* Ax extra argument for previous opcode */ | |||
241 | (*) In OP_RETURN, if (B == 0) then return up to `top'. | 241 | (*) In OP_RETURN, if (B == 0) then return up to `top'. |
242 | 242 | ||
243 | (*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next | 243 | (*) In OP_SETLIST, if (B == 0) then B = `top'; if (C == 0) then next |
244 | `instruction' is EXTRAARG(real C). | 244 | 'instruction' is EXTRAARG(real C). |
245 | |||
246 | (*) In OP_LOADK, OP_GETGLOBAL, and OP_SETGLOBAL, if (Bx == 0) then next | ||
247 | 'instruction' is EXTRAARG(real Bx). | ||
245 | 248 | ||
246 | (*) For comparisons, A specifies what condition the test should accept | 249 | (*) For comparisons, A specifies what condition the test should accept |
247 | (true or false). | 250 | (true or false). |