aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 2094b2d3..f41b35f2 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.39 2000/02/11 16:52:54 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.40 2000/02/14 16:51:08 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*/
@@ -47,6 +47,11 @@
47 47
48 48
49 49
50/*
51** K = U argument used as index to `kstr'
52** J = S argument used as jump offset (relative to pc of next instruction)
53*/
54
50typedef enum { 55typedef enum {
51/* name parm before after side effect 56/* name parm before after side effect
52-----------------------------------------------------------------------------*/ 57-----------------------------------------------------------------------------*/
@@ -60,24 +65,25 @@ PUSHNIL,/* U - nil_0-nil_u */
60POP,/* U a_u-a_1 - */ 65POP,/* U a_u-a_1 - */
61 66
62PUSHINT,/* S - (real)s */ 67PUSHINT,/* S - (real)s */
63PUSHSTRING,/* U - KSTR[u] */ 68PUSHSTRING,/* K - KSTR[k] */
64PUSHNUMBER,/* U - KNUM[u] */ 69PUSHNUM,/* U - KNUM[u] */
70PUSHNEGNUM,/* U - -KNUM[u] */
65 71
66PUSHUPVALUE,/* U - Closure[u] */ 72PUSHUPVALUE,/* U - Closure[u] */
67 73
68PUSHLOCAL,/* U - LOC[u] */ 74PUSHLOCAL,/* U - LOC[u] */
69GETGLOBAL,/* U - VAR[CNST[u]] */ 75GETGLOBAL,/* K - VAR[CNST[k]] */
70 76
71GETTABLE,/* - i t t[i] */ 77GETTABLE,/* - i t t[i] */
72GETDOTTED,/* U t t[CNST[u]] */ 78GETDOTTED,/* K t t[KSTR[k]] */
73PUSHSELF,/* U t t t[CNST[u]] */ 79PUSHSELF,/* K t t t[KSTR[k]] */
74 80
75CREATETABLE,/* U - newarray(size = u) */ 81CREATETABLE,/* U - newarray(size = u) */
76 82
77SETLOCAL,/* U x - LOC[u]=x */ 83SETLOCAL,/* U x - LOC[u]=x */
78SETGLOBAL,/* U x - VAR[CNST[u]]=x */ 84SETGLOBAL,/* K x - VAR[KSTR[k]]=x */
79SETTABLEPOP,/* - v i t - t[i]=v */ 85SETTABLEPOP,/* - v i t - t[i]=v */
80SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */ 86SETTABLE,/* U v a_u-a_1 i t a_u-a_1 i t t[i]=v */
81 87
82SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */ 88SETLIST,/* A B v_b-v_0 t t t[i+a*FPF]=v_i */
83SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */ 89SETMAP,/* U v_u k_u - v_0 k_0 t t t[k_i]=v_i */
@@ -88,7 +94,9 @@ LTOP,/* - y x (x<y)? 1 : nil */
88LEOP,/* - y x (x<y)? 1 : nil */ 94LEOP,/* - y x (x<y)? 1 : nil */
89GTOP,/* - y x (x>y)? 1 : nil */ 95GTOP,/* - y x (x>y)? 1 : nil */
90GEOP,/* - y x (x>=y)? 1 : nil */ 96GEOP,/* - y x (x>=y)? 1 : nil */
97
91ADDOP,/* - y x x+y */ 98ADDOP,/* - y x x+y */
99ADDI,/* S x x+s */
92SUBOP,/* - y x x-y */ 100SUBOP,/* - y x x-y */
93MULTOP,/* - y x x*y */ 101MULTOP,/* - y x x*y */
94DIVOP,/* - y x x/y */ 102DIVOP,/* - y x x/y */
@@ -97,11 +105,11 @@ CONCOP,/* - y x x..y */
97MINUSOP,/* - x -x */ 105MINUSOP,/* - x -x */
98NOTOP,/* - x (x==nil)? 1 : nil */ 106NOTOP,/* - x (x==nil)? 1 : nil */
99 107
100ONTJMP,/* S x (x!=nil)? x : - (x!=nil)? PC+=s */ 108ONTJMP,/* J x (x!=nil)? x : - (x!=nil)? PC+=s */
101ONFJMP,/* S x (x==nil)? x : - (x==nil)? PC+=s */ 109ONFJMP,/* J x (x==nil)? x : - (x==nil)? PC+=s */
102JMP,/* S - - PC+=s */ 110JMP,/* J - - PC+=s */
103IFTJMP,/* S x - (x!=nil)? PC+=s */ 111IFTJMP,/* J x - (x!=nil)? PC+=s */
104IFFJMP,/* S x - (x==nil)? PC+=s */ 112IFFJMP,/* J x - (x==nil)? PC+=s */
105 113
106CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_b-v_1) */ 114CLOSURE,/* A B v_b-v_1 closure(CNST[a], v_b-v_1) */
107 115
@@ -111,7 +119,7 @@ SETLINE/* U - - LINE=u */
111 119
112 120
113#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */ 121#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */
114#define LFIELDS_PER_FLUSH 64 /* FPF - lists (SETLIST) (<MAXARG_B) */ 122#define LFIELDS_PER_FLUSH 64 /* FPF - lists (SETLIST) (<=MAXARG_B) */
115 123
116 124
117#endif 125#endif