aboutsummaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-05-28 18:07:32 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1996-05-28 18:07:32 -0300
commit9863223fbf512d903a1677c861e4beb4f8feda4d (patch)
tree964f1b36a5a7c9aff238d454fa4bffe88dacbe2d /opcode.h
parent9a1948e67d940d988260e738f2a251087835a318 (diff)
downloadlua-9863223fbf512d903a1677c861e4beb4f8feda4d.tar.gz
lua-9863223fbf512d903a1677c861e4beb4f8feda4d.tar.bz2
lua-9863223fbf512d903a1677c861e4beb4f8feda4d.zip
first version of vararg facility (plus new function "call").
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/opcode.h b/opcode.h
index 9b404a83..85ec1cb8 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1,6 +1,6 @@
1/* 1/*
2** TeCGraf - PUC-Rio 2** TeCGraf - PUC-Rio
3** $Id: opcode.h,v 3.19 1996/03/06 13:11:23 roberto Exp $ 3** $Id: opcode.h,v 3.20 1996/03/15 13:13:13 roberto Exp roberto $
4*/ 4*/
5 5
6#ifndef opcode_h 6#ifndef opcode_h
@@ -65,7 +65,8 @@ typedef enum
65 CALLFUNC, 65 CALLFUNC,
66 RETCODE0, 66 RETCODE0,
67 RETCODE, 67 RETCODE,
68 SETLINE 68 SETLINE,
69 VARARGS
69} OpCode; 70} OpCode;
70 71
71#define MULT_RET 255 72#define MULT_RET 255
@@ -107,28 +108,10 @@ typedef struct Object
107#define s_fvalue(i) (fvalue(&s_object(i))) 108#define s_fvalue(i) (fvalue(&s_object(i)))
108#define s_uvalue(i) (uvalue(&s_object(i))) 109#define s_uvalue(i) (uvalue(&s_object(i)))
109 110
110typedef union 111#define get_word(code,pc) {memcpy(&code, pc, sizeof(Word)); pc+=sizeof(Word);}
111{ 112#define get_float(code,pc){memcpy(&code, pc, sizeof(real)); pc+=sizeof(real);}
112 struct {Byte c1; Byte c2;} m; 113#define get_code(code,pc) {memcpy(&code, pc, sizeof(TFunc *)); \
113 Word w; 114 pc+=sizeof(TFunc *);}
114} CodeWord;
115#define get_word(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;}
116
117typedef union
118{
119 struct {Byte c1; Byte c2; Byte c3; Byte c4;} m;
120 float f;
121} CodeFloat;
122#define get_float(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
123 code.m.c3 = *pc++; code.m.c4 = *pc++;}
124
125typedef union
126{
127 struct {Byte c1; Byte c2; Byte c3; Byte c4;} m;
128 TFunc *tf;
129} CodeCode;
130#define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
131 code.m.c3 = *pc++; code.m.c4 = *pc++;}
132 115
133 116
134/* Exported functions */ 117/* Exported functions */
@@ -139,5 +122,6 @@ Object *luaI_Address (lua_Object o);
139void luaI_pushobject (Object *o); 122void luaI_pushobject (Object *o);
140void luaI_gcFB (Object *o); 123void luaI_gcFB (Object *o);
141int luaI_dorun (TFunc *tf); 124int luaI_dorun (TFunc *tf);
125void luaI_packarg (Object *firstelem, Object *arg);
142 126
143#endif 127#endif