diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-07 16:35:31 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-04-07 16:35:31 -0300 |
| commit | 1eabd0549e165fe8e907afad9df314cbec3fab5d (patch) | |
| tree | f2b0c97d93628ecd13912b9473f8a5bb038d058a | |
| parent | 54dd5cc7fd42a8b073f64b7d16efdb1ed01e2dd5 (diff) | |
| download | lua-1eabd0549e165fe8e907afad9df314cbec3fab5d.tar.gz lua-1eabd0549e165fe8e907afad9df314cbec3fab5d.tar.bz2 lua-1eabd0549e165fe8e907afad9df314cbec3fab5d.zip | |
comments
Diffstat (limited to '')
| -rw-r--r-- | lopcodes.h | 26 |
1 files changed, 13 insertions, 13 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.54 2000/04/04 20:48:44 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.55 2000/04/07 13:12:50 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 | */ |
| @@ -81,7 +81,7 @@ | |||
| 81 | /* | 81 | /* |
| 82 | ** K = U argument used as index to `kstr' | 82 | ** K = U argument used as index to `kstr' |
| 83 | ** J = S argument used as jump offset (relative to pc of next instruction) | 83 | ** J = S argument used as jump offset (relative to pc of next instruction) |
| 84 | ** L = U argument used as index of local variable | 84 | ** L = unsigned argument used as index of local variable |
| 85 | ** N = U argument used as index to `knum' | 85 | ** N = U argument used as index to `knum' |
| 86 | */ | 86 | */ |
| 87 | 87 | ||
| @@ -89,8 +89,8 @@ typedef enum { | |||
| 89 | /*---------------------------------------------------------------------- | 89 | /*---------------------------------------------------------------------- |
| 90 | name args stack before stack after side effects | 90 | name args stack before stack after side effects |
| 91 | ------------------------------------------------------------------------*/ | 91 | ------------------------------------------------------------------------*/ |
| 92 | OP_END,/* - - (return) */ | 92 | OP_END,/* - - (return) no results */ |
| 93 | OP_RETURN,/* U - (return) */ | 93 | OP_RETURN,/* U v_n-v_x(at u) (return) returns v_x-v_n */ |
| 94 | 94 | ||
| 95 | OP_CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */ | 95 | OP_CALL,/* A B v_n-v_1 f(at a) r_b-r_1 f(v1,...,v_n) */ |
| 96 | OP_TAILCALL,/* A B v_n-v_1 f(at a) (return) f(v1,...,v_n) */ | 96 | OP_TAILCALL,/* A B v_n-v_1 f(at a) (return) f(v1,...,v_n) */ |
| @@ -100,29 +100,29 @@ OP_POP,/* U a_u-a_1 - */ | |||
| 100 | 100 | ||
| 101 | OP_PUSHINT,/* S - (Number)s */ | 101 | OP_PUSHINT,/* S - (Number)s */ |
| 102 | OP_PUSHSTRING,/* K - KSTR[k] */ | 102 | OP_PUSHSTRING,/* K - KSTR[k] */ |
| 103 | OP_PUSHNUM,/* N - KNUM[u] */ | 103 | OP_PUSHNUM,/* N - KNUM[n] */ |
| 104 | OP_PUSHNEGNUM,/* N - -KNUM[u] */ | 104 | OP_PUSHNEGNUM,/* N - -KNUM[n] */ |
| 105 | 105 | ||
| 106 | OP_PUSHUPVALUE,/* U - Closure[u] */ | 106 | OP_PUSHUPVALUE,/* U - Closure[u] */ |
| 107 | 107 | ||
| 108 | OP_GETLOCAL,/* L - LOC[u] */ | 108 | OP_GETLOCAL,/* L - LOC[l] */ |
| 109 | OP_GETGLOBAL,/* K - VAR[KSTR[k]] */ | 109 | OP_GETGLOBAL,/* K - VAR[KSTR[k]] */ |
| 110 | 110 | ||
| 111 | OP_GETTABLE,/* - i t t[i] */ | 111 | OP_GETTABLE,/* - i t t[i] */ |
| 112 | OP_GETDOTTED,/* K t t[KSTR[k]] */ | 112 | OP_GETDOTTED,/* K t t[KSTR[k]] */ |
| 113 | OP_GETINDEXED,/* L t t[LOC[U]] */ | 113 | OP_GETINDEXED,/* L t t[LOC[l]] */ |
| 114 | OP_PUSHSELF,/* K t t t[KSTR[k]] */ | 114 | OP_PUSHSELF,/* K t t t[KSTR[k]] */ |
| 115 | 115 | ||
| 116 | OP_CREATETABLE,/* U - newarray(size = u) */ | 116 | OP_CREATETABLE,/* U - newarray(size = u) */ |
| 117 | 117 | ||
| 118 | OP_SETLOCAL,/* L B v_b-v_1 - LOC[L]=v_b */ | 118 | OP_SETLOCAL,/* L B v_b-v_1 - LOC[l]=v_b */ |
| 119 | OP_SETGLOBAL,/* K x - VAR[KSTR[k]]=x */ | 119 | OP_SETGLOBAL,/* K x - VAR[KSTR[k]]=x */ |
| 120 | OP_SETTABLE,/* A B v a_a-a_1 i t a_x-a_1 i t t[i]=v */ | 120 | OP_SETTABLE,/* A B v a_a-a_1 i t (pops b values) t[i]=v */ |
| 121 | 121 | ||
| 122 | OP_SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ | 122 | OP_SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ |
| 123 | OP_SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ | 123 | OP_SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ |
| 124 | 124 | ||
| 125 | OP_INCLOCAL,/* sA L - - LOC[L]+=sA */ | 125 | OP_INCLOCAL,/* sA L - - LOC[l]+=sA */ |
| 126 | OP_ADD,/* - y x x+y */ | 126 | OP_ADD,/* - y x x+y */ |
| 127 | OP_ADDI,/* S x x+s */ | 127 | OP_ADDI,/* S x x+s */ |
| 128 | OP_SUB,/* - y x x-y */ | 128 | OP_SUB,/* - y x x-y */ |
| @@ -140,9 +140,9 @@ OP_JMPLE,/* J y x - (x<y)? PC+=s */ | |||
| 140 | OP_JMPGT,/* J y x - (x>y)? PC+=s */ | 140 | OP_JMPGT,/* J y x - (x>y)? PC+=s */ |
| 141 | OP_JMPGE,/* J y x - (x>=y)? PC+=s */ | 141 | OP_JMPGE,/* J y x - (x>=y)? PC+=s */ |
| 142 | 142 | ||
| 143 | OP_JMPT,/* J x - (x!=nil)? PC+=s */ | 143 | OP_JMPT,/* J x - (x~=nil)? PC+=s */ |
| 144 | OP_JMPF,/* J x - (x==nil)? PC+=s */ | 144 | OP_JMPF,/* J x - (x==nil)? PC+=s */ |
| 145 | OP_JMPONT,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */ | 145 | OP_JMPONT,/* J x (x~=nil)? x : - (x~=nil)? PC+=s */ |
| 146 | OP_JMPONF,/* J x (x==nil)? x : - (x==nil)? PC+=s */ | 146 | OP_JMPONF,/* J x (x==nil)? x : - (x==nil)? PC+=s */ |
| 147 | OP_JMP,/* J - - PC+=s */ | 147 | OP_JMP,/* J - - PC+=s */ |
| 148 | 148 | ||
