aboutsummaryrefslogtreecommitdiff
path: root/opcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'opcode.h')
-rw-r--r--opcode.h45
1 files changed, 20 insertions, 25 deletions
diff --git a/opcode.h b/opcode.h
index f375c7d7..599ece26 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1,12 +1,13 @@
1/* 1/*
2** TeCGraf - PUC-Rio 2** TeCGraf - PUC-Rio
3** $Id: opcode.h,v 3.8 1994/11/10 17:36:54 roberto Exp roberto $ 3** $Id: opcode.h,v 3.9 1994/11/23 14:31:11 roberto Stab $
4*/ 4*/
5 5
6#ifndef opcode_h 6#ifndef opcode_h
7#define opcode_h 7#define opcode_h
8 8
9#include "lua.h" 9#include "lua.h"
10#include "types.h"
10#include "tree.h" 11#include "tree.h"
11 12
12#ifndef STACKGAP 13#ifndef STACKGAP
@@ -21,29 +22,6 @@
21 22
22#define MAX_TEMPS 20 23#define MAX_TEMPS 20
23 24
24typedef unsigned char Byte;
25
26typedef unsigned short Word;
27
28typedef signed long Long;
29
30typedef union
31{
32 struct {char c1; char c2;} m;
33 Word w;
34} CodeWord;
35
36typedef union
37{
38 struct {char c1; char c2; char c3; char c4;} m;
39 float f;
40} CodeFloat;
41
42typedef union
43{
44 struct {char c1; char c2; char c3; char c4;} m;
45 Byte *b;
46} CodeCode;
47 25
48typedef enum 26typedef enum
49{ 27{
@@ -147,12 +125,29 @@ typedef struct
147#define s_fvalue(i) (fvalue(&s_object(i))) 125#define s_fvalue(i) (fvalue(&s_object(i)))
148#define s_uvalue(i) (uvalue(&s_object(i))) 126#define s_uvalue(i) (uvalue(&s_object(i)))
149 127
128typedef union
129{
130 struct {char c1; char c2;} m;
131 Word w;
132} CodeWord;
150#define get_word(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;} 133#define get_word(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;}
134
135typedef union
136{
137 struct {char c1; char c2; char c3; char c4;} m;
138 float f;
139} CodeFloat;
151#define get_float(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\ 140#define get_float(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
152 code.m.c3 = *pc++; code.m.c4 = *pc++;} 141 code.m.c3 = *pc++; code.m.c4 = *pc++;}
142
143typedef union
144{
145 struct {char c1; char c2; char c3; char c4;} m;
146 Byte *b;
147} CodeCode;
153#define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\ 148#define get_code(code,pc) {code.m.c1 = *pc++; code.m.c2 = *pc++;\
154 code.m.c3 = *pc++; code.m.c4 = *pc++;} 149 code.m.c3 = *pc++; code.m.c4 = *pc++;}
155 150
156 151
157/* Exported functions */ 152/* Exported functions */
158char *lua_strdup (char *l); 153char *lua_strdup (char *l);