diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-04 14:36:16 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-04 14:36:16 -0200 |
commit | cbc58af26094ad6498c4160cf9710adc7883aa94 (patch) | |
tree | 8caa9f7162543ec4e224b2abbf038cb06d0f94ad /lopcodes.h | |
parent | 80001ab0eb3ad95f370796b26dacfdd7e9874877 (diff) | |
download | lua-cbc58af26094ad6498c4160cf9710adc7883aa94.tar.gz lua-cbc58af26094ad6498c4160cf9710adc7883aa94.tar.bz2 lua-cbc58af26094ad6498c4160cf9710adc7883aa94.zip |
new opcode for "long" arguments (3 bytes)
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 32 |
1 files changed, 27 insertions, 5 deletions
@@ -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) */ | |||
100 | CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ | 98 | CALLFUNC,/* b c v_c...v_1 f r_b...r_1 f(v1,...,v_c) */ |
101 | 99 | ||
102 | SETLINEW,/* w - - LINE=w */ | 100 | SETLINEW,/* w - - LINE=w */ |
103 | SETLINE /* b - - LINE=b */ | 101 | SETLINE,/* b - - LINE=b */ |
102 | |||
103 | LONGARG /* 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 |