aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 66af79f1..9d29fed9 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lopcodes.h,v 1.19 1999/02/02 17:57:49 roberto Exp roberto $ 2** $Id: lopcodes.h,v 1.20 1999/02/02 19:41:17 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*/
@@ -8,8 +8,6 @@
8#define lopcodes_h 8#define lopcodes_h
9 9
10 10
11#define NUMOFFSET 100
12
13/* 11/*
14** NOTICE: variants of the same opcode must be consecutive: First, those 12** NOTICE: variants of the same opcode must be consecutive: First, those
15** with word parameter, then with byte parameter. 13** with word parameter, then with byte parameter.
@@ -100,14 +98,38 @@ CLOSURE,/* b c v_c...v_1 closure(CNST[b], v_c...v_1) */
100CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ 98CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */
101 99
102SETLINEW,/* w - - LINE=w */ 100SETLINEW,/* w - - LINE=w */
103SETLINE /* b - - LINE=b */ 101SETLINE,/* b - - LINE=b */
102
103LONGARG /* b (add b*(1<<16) to arg of next instruction) */
104 104
105} OpCode; 105} OpCode;
106 106
107 107
108#define NUMOFFSET 100 /* offset for immediate numbers */
109
108#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */ 110#define RFIELDS_PER_FLUSH 32 /* records (SETMAP) */
109#define LFIELDS_PER_FLUSH 64 /* lists (SETLIST) */ 111#define LFIELDS_PER_FLUSH 64 /* FPF - lists (SETLIST) */
110 112
111#define ZEROVARARG 64 113#define ZEROVARARG 64
112 114
115
116/* maximum value of an arg of 3 bytes; must fit in an "int" */
117#if MAX_INT < (1<<24)
118#define MAX_ARG MAX_INT
119#else
120#define MAX_ARG ((1<<24)-1)
121#endif
122
123/* maximum value of a word of 2 bytes; cannot be bigger than MAX_ARG */
124#if MAX_ARG < (1<<16)
125#define MAX_WORD MAX_ARG
126#else
127#define MAX_WORD ((1<<16)-1)
128#endif
129
130
131/* maximum value of a byte */
132#define MAX_BYTE ((1<<8)-1)
133
134
113#endif 135#endif