1
2
3
4
5
6
7
8
9
10
11
12
13 expevl_:
14 proc (tbool, inexp, lc, expevl_answer) ;
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 % include varcom;
54 % include concom;
55 % include erflgs;
56 % include codtab;
57 % include curlc;
58
59
60
61 declare getid_$getid_ external entry,
62 inputs_$next external entry ;
63
64
65
66 declare glpl_$clh external entry (fixed bin) returns (fixed bin),
67 glpl_$crh external entry (fixed bin) returns (fixed bin),
68 table_$table_ external entry (fixed bin (26), fixed bin (26), fixed bin, fixed bin (26), fixed bin) returns (fixed bin (26));
69
70
71
72
73 declare (eb_data_$ilend, eb_data_$ineg, eb_data_$inot) ext fixed bin (35);
74
75
76
77
78 declare expevl_answer fixed bin (35) ;
79
80
81 declare (inexp, i, lc, l1, l2, lstk (100), op, rprec,
82 stk (100), tbad, tbool, val, vlc, radix, brk_temp) fixed bin (17);
83
84 declare nstk fixed bin internal static init (100);
85
86
87
88
89 label_100:
90 radix = 10 -tbool - tbool ;
91 expevl_answer = 1; ;
92 tbad = 0; ;
93 i = 1;
94 stk (1) = eb_data_$ilend;
95 go to label_210;
96
97
98 label_200:
99 call getid_$getid_;
100 label_210:
101 if (brk (1) = inum) then go to label_230;
102 if (sym (1) = 0) then go to label_300;
103
104
105 label_220:
106 if (table_$table_ (iserch, sym (1), val, clint, vlc) ^= 0) then go to label_400;
107 if (table_$table_ (iserch, sym (1), val, clmlc, vlc) ^= 0) then go to label_400;
108 if (table_$table_ (iserch, sym (1), val, clstk, vlc) ^= 0) then go to label_400;
109 label_225:
110 prntu = 1; ;
111 expevl_answer = 0; ;
112 go to label_400;
113
114
115 label_230:
116 unspec (val) = unspec (brk (2)) & "000000000000000000000000000000001111"b;
117 vlc = 0;
118 label_240:
119 call inputs_$next;
120 if (brk (1) ^= inum) then go to label_400;
121 val = radix * val + fixed (unspec (brk (2)) & "000000000000000000000000000000001111"b, 17, 0) ;
122 go to label_240;
123
124
125 label_300:
126 brk_temp = brk (1);
127 if (brk_temp = iplus) then go to label_310;
128 if (brk_temp = iminus) then go to label_320;
129 if (brk_temp = istar) then go to label_330;
130 if (brk_temp = islash) then go to label_340;
131 if (brk_temp = icflx) then go to label_340;
132 if (brk_temp = ilpar) then go to label_350;
133 go to label_360;
134
135
136 label_310:
137 go to label_200;
138
139
140 label_320:
141 i = i+1;
142 stk (i) = eb_data_$ineg;
143 go to label_200;
144
145
146 label_330:
147 val = pc;
148 vlc = curlc;
149 call getid_$getid_;
150 if (sym (1) ^= 0) then go to label_800;
151 go to label_400;
152
153
154 label_340:
155 i = i+1;
156 stk (i) = eb_data_$inot;
157 go to label_200;
158
159
160 label_350:
161 i = i+1;
162 stk (i) = ilpar;
163 go to label_200;
164
165
166 label_360:
167 val = 0;
168 vlc = 0;
169 go to label_400;
170
171
172
173
174
175
176
177
178 label_400:
179 if (i > (nstk-4)) then go to label_800;
180 i = i+1;
181 stk (i) = val;
182 lstk (i) = vlc;
183 label_410:
184 unspec (rprec) = unspec (brk (1)) & "000000000000000000000000000000001111"b;
185 label_420:
186 op = stk (i-1);
187 if fixed (unspec (op) & "000000000000000000000000000000001111"b, 17, 0) >= rprec then goto label_460;
188 if (brk (1) = irpar) then go to label_450;
189 if (rprec <= 4) then go to label_440;
190
191
192 label_430:
193 i = i+1;
194 stk (i) = brk (1);
195 go to label_200;
196
197
198 label_440:
199 if (i ^= 2) then go to label_800;
200 go to label_900;
201
202
203 label_450:
204 if (op = eb_data_$ilend) then go to label_440;
205 if (op ^= ilpar) then go to label_800;
206 i = i-1;
207 stk (i) = stk (i+1);
208 lstk (i) = lstk (i+1);
209 call getid_$getid_;
210 if (sym (1) ^= 0) then go to label_800;
211 go to label_410;
212
213
214
215 label_460:
216 if (tbool ^= 0) then go to label_600;
217
218
219 label_500:
220 l1 = lstk (i-2);
221 l2 = lstk (i);
222 if (op = iplus) then go to label_510;
223 if (op = iminus) then go to label_520;
224 if (op = istar) then go to label_530;
225 if (op = islash) then go to label_540;
226 if (op = eb_data_$ineg) then go to label_550;
227 if (op = eb_data_$ilend) then go to label_900;
228 go to label_800;
229
230
231 label_510:
232 stk (i-2) = stk (i-2)+stk (i);
233 if (l1 ^= 0 & l2 ^= 0) then tbad = 1; ;
234 if (l1+l2 = 0) then vlc = 0;
235 if (l1 ^= 0) then vlc = l1;
236 if (l2 ^= 0) then vlc = l2;
237 go to label_700;
238
239
240
241
242
243
244
245
246
247
248 label_520:
249 stk (i-2) = stk (i-2)-stk (i);
250 if (^(tpass2 ^= 0 & l1 ^= 0 & l2 ^= 0)) then go to label_525;
251 if (glpl_$crh (l1+4) ^= glpl_$crh (l2+4)) then tbad = 1; ;
252 stk (i-2) = stk (i-2) + (glpl_$clh (l1+3)-glpl_$clh (l2+3));
253 vlc = 0;
254 go to label_700;
255 label_525:
256
257
258 if (l2 ^= 0 & l1 ^= l2) then tbad = 1; ;
259 if (l1+l2 = 0) then vlc = 0;
260 if (l1 ^= 0 & l2 = 0) then vlc = l1;
261 if (l1 ^= 0 & l2 ^= 0) then vlc = 0;
262 go to label_700;
263
264
265 label_530:
266 stk (i-2) = stk (i-2)*stk (i);
267 if (l1+l2 ^= 0) then tbad = 1; ;
268 vlc = 0;
269 go to label_700;
270
271
272 label_540:
273 if (stk (i) ^= 0) then stk (i-2) = divide (stk (i-2), stk (i), 17, 0);
274 if (l1+l2 ^= 0) then tbad = 1; ;
275 vlc = 0;
276 go to label_700;
277
278
279 label_550:
280 stk (i-1) = -stk (i);
281 if (lstk (i) ^= 0) then tbad = 1; ;
282 vlc = 0;
283 go to label_710;
284
285
286
287 label_600:
288 if (op = iplus) then go to label_610;
289 if (op = iminus) then go to label_620;
290 if (op = istar) then go to label_630;
291 if (op = islash) then go to label_640;
292 if (op = icflx) then go to label_640;
293 if (op = eb_data_$inot) then go to label_650;
294 if (op = eb_data_$ilend) then go to label_900;
295 go to label_800;
296
297
298 label_610:
299 unspec (stk (i-2)) = unspec (stk (i-2)) | unspec (stk (i)) ;
300 go to label_700;
301
302
303 label_620:
304 unspec (stk (i-2)) = bool (unspec (stk (i-2)), unspec (stk (i)), "0110"b) ;
305 go to label_700;
306
307
308 label_630:
309 unspec (stk (i-2)) = unspec (stk (i-2)) & unspec (stk (i)) ;
310 go to label_700;
311
312
313 label_640:
314 unspec (stk (i-2)) = unspec (stk (i-2)) & ^unspec (stk (i)) ;
315 go to label_700;
316
317
318 label_650:
319 stk (i-1) = -1 - stk (i) ;
320 go to label_710;
321
322
323
324
325 label_700:
326 lstk (i-2) = vlc;
327 i = i-2;
328 if (i >= 2) then go to label_420;
329 go to label_800;
330
331
332 label_710:
333 lstk (i-1) = vlc;
334 i = i-1;
335 if (i >= 2) then go to label_420;
336 go to label_800;
337
338
339
340 label_800:
341 prntf = 1;
342 expevl_answer = 0;
343 label_810:
344 inexp = 0;
345 lc = 0;
346 return ;
347
348
349
350 label_900:
351 inexp = stk (2);
352 if (tbad ^= 0) then go to label_910;
353 lc = lstk (2);
354 return ;
355
356
357 label_910:
358 lc = 0;
359 if tpass1 = 0 then prntr = 1;
360 expevl_answer = 0; ;
361 return ;
362
363
364 end expevl_;