diff options
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.73 2001/06/05 18:17:01 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.74 2001/06/08 19:00:57 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 | */ |
@@ -153,20 +153,20 @@ OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ | |||
153 | OP_JMP,/* sBc PC += sBc */ | 153 | OP_JMP,/* sBc PC += sBc */ |
154 | OP_CJMP,/* sBc if test then PC += sBc (see (1)) */ | 154 | OP_CJMP,/* sBc if test then PC += sBc (see (1)) */ |
155 | 155 | ||
156 | OP_TESTEQ,/* B C test := (R(B) == R/K(C)) */ | 156 | OP_TESTEQ,/* A C test := (R(A) == R/K(C)) */ |
157 | OP_TESTNE,/* B C test := (R(B) ~= R/K(C)) */ | 157 | OP_TESTNE,/* A C test := (R(A) ~= R/K(C)) */ |
158 | OP_TESTLT,/* B C test := (R(B) < R/K(C)) */ | 158 | OP_TESTLT,/* A C test := (R(A) < R/K(C)) */ |
159 | OP_TESTLE,/* B C test := (R(B) <= R/K(C)) */ | 159 | OP_TESTLE,/* A C test := (R(A) <= R/K(C)) */ |
160 | OP_TESTGT,/* B C test := (R(B) > R/K(C)) */ | 160 | OP_TESTGT,/* A C test := (R(A) > R/K(C)) */ |
161 | OP_TESTGE,/* B C test := (R(B) >= R/K(C)) */ | 161 | OP_TESTGE,/* A C test := (R(A) >= R/K(C)) */ |
162 | 162 | ||
163 | OP_TESTT,/* A B test := R(B); if (test) R(A) := R(B) */ | 163 | OP_TESTT,/* A B test := R(B); if (test) R(A) := R(B) */ |
164 | OP_TESTF,/* A B test := not R(B); if (test) R(A) := nil */ | 164 | OP_TESTF,/* A B test := not R(B); if (test) R(A) := nil */ |
165 | 165 | ||
166 | OP_NILJMP,/* A R(A) := nil; PC++; */ | 166 | OP_NILJMP,/* A R(A) := nil; PC++; */ |
167 | 167 | ||
168 | OP_CALL,/* A B C R(A), ... ,R(C-1) := R(A)(R(A+1), ... ,R(B-1)) */ | 168 | OP_CALL,/* A B C R(A), ... ,R(A+C-1) := R(A)(R(A+1), ... ,R(A+B))*/ |
169 | OP_RETURN,/* A B return R(A), ... ,R(B-1) (see (3)) */ | 169 | OP_RETURN,/* A B return R(A), ... ,R(A+B-1) (see (3)) */ |
170 | 170 | ||
171 | OP_FORPREP,/* A sBc */ | 171 | OP_FORPREP,/* A sBc */ |
172 | OP_FORLOOP,/* A sBc */ | 172 | OP_FORLOOP,/* A sBc */ |
@@ -191,10 +191,10 @@ OP_CLOSURE /* A Bc R(A) := closure(KPROTO[Bc], R(A), ... ,R(A+n)) */ | |||
191 | instructions OP_TEST* and OP_CJMP must always occur together. | 191 | instructions OP_TEST* and OP_CJMP must always occur together. |
192 | 192 | ||
193 | (2) In OP_CALL, if (B == NO_REG) then B = top. C is the number of returns, | 193 | (2) In OP_CALL, if (B == NO_REG) then B = top. C is the number of returns, |
194 | and can be NO_REG. OP_CALL always set "top" to last_result+1, so | 194 | and can be NO_REG. OP_CALL can set `top' to last_result+1, so |
195 | next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use "top". | 195 | next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. |
196 | 196 | ||
197 | (3) In OP_RETURN, if (B == NO_REG) then B = top. | 197 | (3) In OP_RETURN, if (B == NO_REG) then return up to `top' |
198 | ===========================================================================*/ | 198 | ===========================================================================*/ |
199 | 199 | ||
200 | 200 | ||