diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:09:00 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-05-13 10:09:00 -0300 |
| commit | af19d556355b6e79296811cb18fe511f8784b8f1 (patch) | |
| tree | 2126e8dec5d21939bb2ff298f29f0d429c62d7db /lopcodes.h | |
| parent | b55fded18c270412e127259a5f28c785620dbf1a (diff) | |
| download | lua-af19d556355b6e79296811cb18fe511f8784b8f1.tar.gz lua-af19d556355b6e79296811cb18fe511f8784b8f1.tar.bz2 lua-af19d556355b6e79296811cb18fe511f8784b8f1.zip | |
generic for also coded to make test at the end of the loop
Diffstat (limited to 'lopcodes.h')
| -rw-r--r-- | lopcodes.h | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.95 2002/04/24 20:07:46 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.96 2002/05/06 15:51:41 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 | */ |
| @@ -170,7 +170,8 @@ OP_FORLOOP,/* A sBx R(A)+=R(A+2); if R(A) <?= R(A+1) then PC+= sBx */ | |||
| 170 | 170 | ||
| 171 | OP_TFORLOOP,/* A C R(A+2), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); | 171 | OP_TFORLOOP,/* A C R(A+2), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); |
| 172 | if R(A+2) ~= nil then pc++ */ | 172 | if R(A+2) ~= nil then pc++ */ |
| 173 | OP_TFORPREP,/* A if type(R(A)) == table then R(A+1):=R(A), R(A):=next */ | 173 | OP_TFORPREP,/* A sBx if type(R(A)) == table then R(A+1):=R(A), R(A):=next; |
| 174 | PC += sBx */ | ||
| 174 | 175 | ||
| 175 | OP_SETLIST,/* A Bx R(A)[Bx-Bx%FPF+i] := R(A+i), 1 <= i <= Bx%FPF+1 */ | 176 | OP_SETLIST,/* A Bx R(A)[Bx-Bx%FPF+i] := R(A+i), 1 <= i <= Bx%FPF+1 */ |
| 176 | OP_SETLISTO,/* A Bx */ | 177 | OP_SETLISTO,/* A Bx */ |
| @@ -193,6 +194,8 @@ OP_CLOSURE/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ | |||
| 193 | (2) In OP_RETURN, if (B == 0) then return up to `top' | 194 | (2) In OP_RETURN, if (B == 0) then return up to `top' |
| 194 | 195 | ||
| 195 | (3) For comparisons, B specifies what conditions the test should accept. | 196 | (3) For comparisons, B specifies what conditions the test should accept. |
| 197 | |||
| 198 | (4) All `skips' (pc++) assume that next instruction is a jump | ||
| 196 | ===========================================================================*/ | 199 | ===========================================================================*/ |
| 197 | 200 | ||
| 198 | 201 | ||
