Documentation fixes
[vlp.git] / src / int / intdt.c
1 #include "depend.h"
2 #include "genint.h"
3 #include "int.h"
4 #include "process.h"
5 #include "intproto.h"
6
7 /**
8  * @file
9  */
10
11 /**
12  * \defgroup Variables common with generator :
13  * @{
14  */
15  
16 /**
17  * prototypes
18  */
19 protdescr *prototype[MAXPROT + 1];
20
21 /**
22  * address of primitive types descriptions
23  */
24 word ipradr;
25
26 /**
27  * address of global temporary variables
28  */
29 word temporary;
30
31 /** 
32  * base for string constants
33  */
34 word strings;
35
36 /**
37  * the last used prototype number
38  */
39 word lastprot;
40
41 /**
42  * first free cell in M
43  */
44 word freem;
45
46 /**
47  * current file virtual address
48  */
49 word currfile = 2;
50 /** @} */
51
52 /**
53  * Interpreter own variables :
54  * @{
55  **/
56  
57 /**
58  * main memory for code and data
59  */
60 memory M;
61
62 /**
63  * for comunication with standard procs
64  */
65 union value *param;
66 /** @} */
67
68 /**
69  * offset conversion table for compactification
70  */
71 int offset[] = { DUMMY, SL, DL, CL, CHD, VIRTSC };
72
73 /**
74  * signal to number conversion table 
75  * -1 stands for an unrecoverable error which cannot be serviced by handler
76  */
77 int scot[] = {
78         /** RTESLCOF */
79         20,
80         /** RTEUNSTP */
81         20,
82         /** RTEILLAT */
83         20,
84         /** RTEILLDT */
85         20,
86         /** RTECORTM */
87         20,
88         /** RTECORAC */
89         20,
90         /** RTEINVIN */
91         23,
92         /** RTEILLAB */
93         23,
94         /** RTEINCQA */
95         21,
96         /** RTEINCAS */
97         24,
98         /** RTEFTPMS */
99         20,
100         /** RTEILLKL */
101         20,
102         /** RTEILLCP */
103         20,
104         /** RTEINCHS */
105         24,
106         /** RTEHNDNF */
107         -1,
108         /** RTEMEMOV */
109         22,
110         /** RTEFHTLG */
111         22,
112         /** RTEILLRT */
113         -1,
114         /** RTEREFTN */
115         21,
116         /** RTEDIVBZ */
117         01,
118         /** RTESYSER */
119         02,
120         /** RTEILLIO */
121         02,
122         /** RTEIOERR */
123         02,
124         /** RTECNTOP */
125         02,
126         /** RTEBADFM */
127         02,
128         /** RTEILLRS */
129         20,
130         /** RTETMPRC */
131         02,
132         /** RTEINVND */
133         02,
134         /** RTENEGST */
135         23,
136         /** RTENONGL */
137         -1
138 };
139
140 /**
141  * Primitive type appetites for moveparams() :
142  */
143 int primapet[] = {
144         /** INTEGER */
145         APINT,
146         /** REAL */
147         APREAL,
148         /** BOOLEAN */
149         APINT,
150         /** CHAR */
151         APINT,
152         /** COROUTINE */
153         APREF,
154         /** PROCESS */
155         APREF,
156         /** STRING */
157         APINT
158 };
159
160 /**
161  * instruction counter
162  */
163 word ic;
164
165 /**
166  * previous ic for redecoding after compact.
167  */
168 word lastic;
169
170 /**
171  * opcode of L-code instruction
172  */
173 int opcode;
174
175 /**
176  * arguments of L-code instructions
177  */
178 word a1, a2, a3;
179
180 /**
181  * \defgroup kernel
182  * \brief variables for the running system
183  */
184 /** @{ */
185 /**
186  * code and data memory size
187  */
188 word memorysize = DEFMEMSIZE;
189
190 /**
191  * pointers to current object
192  */
193 word c1, c2;
194
195 /**
196  * DISPLAY offset in process object
197  */
198 word dispoff;
199 /**
200  * indirect DISPLAY offset in process object
201  */
202 word disp2off;
203
204 /**
205  * DISPLAY address - physical addresses
206  */
207 word display;
208 /**
209  * DISPLAY address - indirect addresses
210  */
211 word display2;
212
213 /**
214  * main block object
215  */
216 word mainprog;
217
218 /**
219  * offset of variable main
220  **/
221 word mnoff;
222
223 /** @} */
224
225 /**
226  * default: no compactification message
227  */
228 bool infmode = FALSE;
229
230 /**
231  * TRUE if trace is printed
232  */
233 bool debug = FALSE;
234
235 /**
236  * output file for trace
237  */
238 FILE *tracefile;
239
240 /**
241  * for continue execution
242  */
243 jmp_buf contenv;