aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/lopcodes.h b/lopcodes.h
index b9539a9a..722e3d6a 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -168,8 +168,8 @@ OP_TESTGE,/* A C test := (R(A) >= R/K(C)) */
168OP_TESTT,/* A B test := R(B); if (test) R(A) := R(B) */ 168OP_TESTT,/* A B test := R(B); if (test) R(A) := R(B) */
169OP_TESTF,/* A B test := not R(B); if (test) R(A) := R(B) */ 169OP_TESTF,/* A B test := not R(B); if (test) R(A) := R(B) */
170 170
171OP_CALL,/* A B C R(A), ... ,R(A+C-1) := R(A)(R(A+1), ... ,R(A+B))*/ 171OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1))*/
172OP_RETURN,/* A B return R(A), ... ,R(A+B-1) (see (3)) */ 172OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see (3)) */
173 173
174OP_FORPREP,/* A sBc */ 174OP_FORPREP,/* A sBc */
175OP_FORLOOP,/* A sBc */ 175OP_FORLOOP,/* A sBc */
@@ -182,6 +182,9 @@ OP_SETLISTO,/* A Bc */
182 182
183OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ 183OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
184OP_CLOSURE /* A Bc R(A) := closure(KPROTO[Bc], R(A), ... ,R(A+n)) */ 184OP_CLOSURE /* A Bc R(A) := closure(KPROTO[Bc], R(A), ... ,R(A+n)) */
185/*----------------------------------------------------------------------
186pseudo-instructions (interruptions): cannot occur in regular code
187------------------------------------------------------------------------*/
185} OpCode; 188} OpCode;
186 189
187 190
@@ -194,11 +197,11 @@ OP_CLOSURE /* A Bc R(A) := closure(KPROTO[Bc], R(A), ... ,R(A+n)) */
194 (1) In the current implementation there is no `test' variable; 197 (1) In the current implementation there is no `test' variable;
195 instructions OP_TEST* and OP_CJMP must always occur together. 198 instructions OP_TEST* and OP_CJMP must always occur together.
196 199
197 (2) In OP_CALL, if (B == NO_REG) then B = top. C is the number of returns, 200 (2) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1,
198 and can be NO_REG. OP_CALL can set `top' to last_result+1, so 201 and can be 0: OP_CALL then sets `top' to last_result+1, so
199 next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. 202 next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'.
200 203
201 (3) In OP_RETURN, if (B == NO_REG) then return up to `top' 204 (3) In OP_RETURN, if (B == 0) then return up to `top'
202===========================================================================*/ 205===========================================================================*/
203 206
204 207
@@ -221,6 +224,12 @@ extern const lu_byte luaP_opmodes[NUM_OPCODES];
221 224
222 225
223/* 226/*
227** constant instructions
228*/
229
230extern const Instruction luaP_yieldop;
231
232/*
224** opcode names (only included when compiled with LUA_OPNAMES) 233** opcode names (only included when compiled with LUA_OPNAMES)
225*/ 234*/
226extern const char *const luaP_opnames[]; 235extern const char *const luaP_opnames[];