1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 dcl call_dtype_functions (4) entry variable
25 init (bit_string_dtype, supported_by_call_dtype, storage_for_pl1_dtype, pl1_dtype_name);
26
27
28 bit_string_dtype:
29 proc (dtype) returns(bit(1) aligned);
30
31 dcl dtype fixed bin;
32
33 dcl 1 attr aligned like data_type_info_$info based(attrP);
34 dcl attrP ptr;
35
36 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
37 attrP = addr(data_type_info_$info(dtype));
38 return (attr.bit_string);
39
40
41 char_string_dtype:
42 entry (dtype) returns(bit(1) aligned);
43
44 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
45 attrP = addr(data_type_info_$info(dtype));
46 return (attr.char_string);
47
48
49 star_extent_dtype:
50 entry (dtype) returns(bit(1) aligned);
51
52 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
53 attrP = addr(data_type_info_$info(dtype));
54 return (attr.bit_string | attr.char_string | (dtype = area_dtype));
55
56
57 string_dtype:
58 entry (dtype) returns(bit(1) aligned);
59
60 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
61 attrP = addr(data_type_info_$info(dtype));
62 return (attr.bit_string | attr.char_string);
63
64
65 varying_string_dtype:
66 entry (dtype) returns(bit(1) aligned);
67
68 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
69 attrP = addr(data_type_info_$info(dtype));
70 return (attr.varying);
71
72
73 fixed_bin_dtype:
74 entry (dtype) returns(bit(1) aligned);
75
76 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
77 attrP = addr(data_type_info_$info(dtype));
78 return (attr.fixed & ^attr.decimal);
79
80
81 fixed_point_dtype:
82 entry (dtype) returns(bit(1) aligned);
83
84 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
85 attrP = addr(data_type_info_$info(dtype));
86 return (attr.fixed);
87
88
89 numeric_dtype:
90 entry (dtype) returns(bit(1) aligned);
91
92 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
93 attrP = addr(data_type_info_$info(dtype));
94 return (attr.arithmetic);
95
96
97 unsigned_dtype:
98 entry (dtype) returns(bit(1) aligned);
99
100 if dtype < 0 | dtype > hbound(data_type_info_$info, 1) then return ("0"b);
101 attrP = addr(data_type_info_$info(dtype));
102 return (attr.arithmetic & ^attr.signed);
103
104 %page;
105 %include data_type_info_;
106
107 end bit_string_dtype;
108 %page;
109 dcl 1 BOUNDARY aligned int static options(constant),
110 2 (Even_Word init(3),
111 Word init(2),
112 Byte init(1),
113 Bit init(0)) fixed bin(2) unsigned;
114
115 storage_for_pl1_dtype:
116 proc (dtype, dunaligned, dsize, boundary, count, code);
117
118 dcl dtype fixed bin;
119
120
121 dcl dunaligned bit(1) aligned;
122
123 dcl dsize fixed bin(24);
124
125
126 dcl boundary fixed bin(2) unsigned;
127 dcl count fixed bin(24);
128
129 dcl code fixed bin(35);
130
131 dcl (call_et_$bad_dtype_alignment,
132 call_et_$dtype_unsupported,
133 call_et_$structure_size_undefined) fixed bin(35) ext static;
134 %page;
135
136 boundary = BOUNDARY.Bit;
137 count = 0;
138 code = 0;
139
140 if ^supported_by_pl1_dtype(dtype) then go to EXIT_storage;
141 dcl subscriptrange condition;
142 on subscriptrange begin;
143 go to EXIT_storage;
144 end;
145 if dunaligned then
146 go to unalStoreSize(dtype);
147 else go to storeSize(dtype);
148
149 storeSize (real_fix_bin_1_uns_dtype):
150 storeSize (real_fix_bin_1_dtype): call st(BOUNDARY.Word, words_per_fix_bin_1);
151 storeSize (real_fix_bin_2_uns_dtype):
152 storeSize (real_fix_bin_2_dtype): call st(BOUNDARY.Even_Word, words_per_fix_bin_2);
153 storeSize (real_flt_bin_1_dtype): call st(BOUNDARY.Word, words_per_flt_bin_1);
154 storeSize (real_flt_bin_2_dtype): call st(BOUNDARY.Even_Word, words_per_flt_bin_2);
155 storeSize (real_fix_dec_9bit_ls_dtype): call st(BOUNDARY.Word,
156 divide(dsize+1+(characters_per_word-1),characters_per_word,24,0));
157 storeSize (real_flt_dec_9bit_dtype): call st(BOUNDARY.Word,
158 divide(dsize+2+(characters_per_word-1),characters_per_word,24,0));
159
160 storeSize (cplx_fix_bin_1_dtype): call st(BOUNDARY.Even_Word, 2*words_per_fix_bin_1);
161 storeSize (cplx_fix_bin_2_dtype): call st(BOUNDARY.Even_Word, 2*words_per_fix_bin_2);
162 storeSize (cplx_flt_bin_1_dtype): call st(BOUNDARY.Even_Word, 2*words_per_flt_bin_1);
163 storeSize (cplx_flt_bin_2_dtype): call st(BOUNDARY.Even_Word, 2*words_per_flt_bin_2);
164 storeSize (cplx_fix_dec_9bit_ls_dtype): call st(BOUNDARY.Word,
165 2*divide(dsize+1+(characters_per_word-1),characters_per_word,24,0));
166 storeSize (cplx_flt_dec_9bit_dtype): call st(BOUNDARY.Word,
167 2* divide(dsize+2+(characters_per_word-1),characters_per_word,24,0));
168
169 storeSize (pointer_dtype): call st(BOUNDARY.Even_Word, words_per_pointer);
170 storeSize (offset_dtype): call st(BOUNDARY.Word, words_per_offset);
171 storeSize (label_dtype): call st(BOUNDARY.Word, words_per_label_var);
172 storeSize (entry_dtype): call st(BOUNDARY.Word, words_per_entry_var);
173 storeSize (area_dtype): call st(BOUNDARY.Even_Word, (dsize) );
174 storeSize (file_dtype): call st(BOUNDARY.Even_Word, words_per_file_var);
175
176 storeSize (char_dtype): call st(BOUNDARY.Word,
177 divide(dsize+(characters_per_word-1),characters_per_word,24,0));
178 storeSize (varying_char_dtype): call st(BOUNDARY.Word,
179 divide(dsize+(characters_per_word-1),characters_per_word,24,0) +
180 words_per_varying_string_header);
181 storeSize (bit_dtype): call st(BOUNDARY.Word,
182 divide(dsize+(bits_per_word-1),bits_per_word,24,0));
183 storeSize (varying_bit_dtype): call st(BOUNDARY.Word,
184 divide(dsize+(bits_per_word-1),bits_per_word,24,0) +
185 words_per_varying_string_header);
186
187 storeSize (structure_dtype):
188 code = call_et_$structure_size_undefined; return;
189 storeSize (real_fix_dec_4bit_bytealigned_ls_dtype):
190 storeSize (real_flt_dec_4bit_bytealigned_dtype):
191 code = call_et_$bad_dtype_alignment; return;
192
193
194 unalStoreSize (real_fix_bin_1_dtype):
195 unalStoreSize (real_fix_bin_2_dtype): call st(BOUNDARY.Bit, dsize+1);
196 unalStoreSize (real_flt_bin_1_dtype):
197 unalStoreSize (real_flt_bin_2_dtype): call st(BOUNDARY.Bit, dsize+9);
198
199 unalStoreSize (real_fix_bin_1_uns_dtype):
200 unalStoreSize (real_fix_bin_2_uns_dtype): call st(BOUNDARY.Bit, (dsize) );
201
202 unalStoreSize (cplx_fix_bin_1_dtype):
203 unalStoreSize (cplx_fix_bin_2_dtype): call st(BOUNDARY.Bit, 2*(dsize+1));
204 unalStoreSize (cplx_flt_bin_1_dtype):
205 unalStoreSize (cplx_flt_bin_2_dtype): call st(BOUNDARY.Bit, 2*(dsize+9));
206 unalStoreSize (cplx_fix_dec_9bit_ls_dtype): call st(BOUNDARY.Byte, 2*(dsize+1));
207 unalStoreSize (cplx_flt_dec_9bit_dtype): call st(BOUNDARY.Byte, 2*(dsize+2));
208
209 unalStoreSize (real_fix_dec_4bit_bytealigned_ls_dtype):
210 call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0));
211 unalStoreSize (real_flt_dec_4bit_bytealigned_dtype):
212
213 call st(BOUNDARY.Byte, divide(dsize+2, packed_digits_per_character,24,0)+1);
214
215 unalStoreSize (pointer_dtype): call st(BOUNDARY.Bit, bits_per_packed_ptr);
216 unalStoreSize (offset_dtype): call st(BOUNDARY.Word, words_per_offset);
217 unalStoreSize (label_dtype): call st(BOUNDARY.Even_Word, words_per_label_var);
218 unalStoreSize (entry_dtype): call st(BOUNDARY.Even_Word, words_per_entry_var);
219 unalStoreSize (area_dtype): call st(BOUNDARY.Even_Word, (dsize) );
220 unalStoreSize (file_dtype): call st(BOUNDARY.Even_Word, words_per_file_var);
221
222 unalStoreSize (char_dtype): call st(BOUNDARY.Byte, (dsize) );
223 unalStoreSize (varying_char_dtype): call st(BOUNDARY.Word,
224 divide(dsize+(characters_per_word-1),characters_per_word,24,0) +
225 words_per_varying_string_header);
226 unalStoreSize (bit_dtype): call st(BOUNDARY.Bit, (dsize) );
227 unalStoreSize (varying_bit_dtype): call st(BOUNDARY.Word,
228 divide(dsize+(bits_per_word-1),bits_per_word,24,0) +
229 words_per_varying_string_header);
230
231 unalStoreSize (structure_dtype):
232 code = call_et_$structure_size_undefined; return;
233 unalStoreSize (real_fix_dec_9bit_ls_dtype):
234 unalStoreSize (real_flt_dec_9bit_dtype): code = call_et_$bad_dtype_alignment; return;
235
236 EXIT_storage:
237 code = call_et_$dtype_unsupported;
238 RETURN_from_storage:
239 return;
240
241 st: proc(bnd, cnt);
242 dcl bnd fixed bin(2) unsigned;
243 dcl cnt fixed bin(31);
244
245 boundary = bnd;
246 count = cnt;
247 go to RETURN_from_storage;
248 end st;
249
250 end storage_for_pl1_dtype;
251 %page;
252
253 supported_by_call_dtype:
254 proc (dtype) returns(bit(1) aligned);
255
256 dcl dtype fixed bin;
257
258 dcl CPLX_FLOAT_DEC_UNAL fixed bin aligned int static options(constant) init(cplx_flt_dec_4bit_bytealigned_dtype);
259
260
261
262 if dtype <= 0 | dtype > CPLX_FLOAT_DEC_UNAL then go to SUPPORTED_no;
263
264 dcl subscriptrange condition;
265 on subscriptrange begin;
266 go to SUPPORTED_no;
267 end;
268 go to supportCall(dtype);
269
270 supportCall (real_fix_bin_1_dtype):
271 supportCall (real_fix_bin_2_dtype):
272 supportCall (real_flt_bin_1_dtype):
273 supportCall (real_flt_bin_2_dtype):
274 supportCall (real_fix_dec_9bit_ls_dtype):
275 supportCall (real_flt_dec_9bit_dtype):
276 supportCall (pointer_dtype):
277 supportCall (entry_dtype):
278 supportCall (area_dtype):
279 supportCall (bit_dtype):
280 supportCall (varying_bit_dtype):
281 supportCall (char_dtype):
282 supportCall (varying_char_dtype):
283 supportCall (real_fix_bin_1_uns_dtype):
284 supportCall (real_fix_bin_2_uns_dtype):
285 supportCall (real_fix_dec_4bit_bytealigned_ls_dtype):
286 supportCall (real_flt_dec_4bit_bytealigned_dtype):
287 go to SUPPORTED_yes;
288
289 supportCall (cplx_fix_bin_1_dtype):
290 supportCall (cplx_fix_bin_2_dtype):
291 supportCall (cplx_flt_bin_1_dtype):
292 supportCall (cplx_flt_bin_2_dtype):
293 supportCall (cplx_fix_dec_9bit_ls_dtype):
294 supportCall (cplx_flt_dec_9bit_dtype):
295 supportCall (cplx_fix_dec_4bit_bytealigned_ls_dtype):
296 supportCall (cplx_flt_dec_4bit_bytealigned_dtype):
297 supportCall (structure_dtype):
298 supportCall (offset_dtype):
299 supportCall (label_dtype):
300 supportCall (file_dtype):
301 supportCall (real_fix_dec_9bit_ls_overp_dtype):
302 supportCall (real_fix_dec_9bit_ts_overp_dtype):
303 supportCall (real_fix_dec_9bit_uns_dtype):
304 supportCall (real_fix_dec_9bit_ts_dtype):
305 supportCall (real_fix_dec_4bit_uns_dtype):
306 supportCall (real_fix_dec_4bit_ts_dtype):
307 supportCall (real_fix_dec_4bit_bytealigned_uns_dtype):
308 supportCall (real_fix_dec_4bit_ls_dtype):
309 supportCall (real_flt_dec_4bit_dtype):
310 go to SUPPORTED_no;
311
312 SUPPORTED_yes:
313 return("1"b);
314
315 SUPPORTED_no:
316 return("0"b);
317
318 end supported_by_call_dtype;
319 %page;
320
321 supported_by_pl1_dtype:
322 proc (dtype) returns(bit(1) aligned);
323
324 dcl dtype fixed bin;
325
326 dcl CPLX_FLOAT_DEC_UNAL fixed bin aligned int static options(constant) init(cplx_flt_dec_4bit_bytealigned_dtype);
327
328
329
330 if dtype <= 0 | dtype > CPLX_FLOAT_DEC_UNAL then go to SUPPORTED_PL1_no;
331
332 dcl subscriptrange condition;
333 on subscriptrange begin;
334 go to SUPPORTED_PL1_no;
335 end;
336 go to supportPL1(dtype);
337
338 supportPL1 (real_fix_bin_1_dtype):
339 supportPL1 (real_fix_bin_2_dtype):
340 supportPL1 (real_flt_bin_1_dtype):
341 supportPL1 (real_flt_bin_2_dtype):
342 supportPL1 (cplx_fix_bin_1_dtype):
343 supportPL1 (cplx_fix_bin_2_dtype):
344 supportPL1 (cplx_flt_bin_1_dtype):
345 supportPL1 (cplx_flt_bin_2_dtype):
346 supportPL1 (real_fix_dec_9bit_ls_dtype):
347 supportPL1 (real_flt_dec_9bit_dtype):
348 supportPL1 (cplx_fix_dec_9bit_ls_dtype):
349 supportPL1 (cplx_flt_dec_9bit_dtype):
350 supportPL1 (pointer_dtype):
351 supportPL1 (offset_dtype):
352 supportPL1 (label_dtype):
353 supportPL1 (entry_dtype):
354 supportPL1 (structure_dtype):
355 supportPL1 (area_dtype):
356 supportPL1 (bit_dtype):
357 supportPL1 (varying_bit_dtype):
358 supportPL1 (char_dtype):
359 supportPL1 (varying_char_dtype):
360 supportPL1 (file_dtype):
361 supportPL1 (real_fix_bin_1_uns_dtype):
362 supportPL1 (real_fix_bin_2_uns_dtype):
363 supportPL1 (real_fix_dec_4bit_bytealigned_ls_dtype):
364 supportPL1 (real_flt_dec_4bit_bytealigned_dtype):
365 supportPL1 (cplx_fix_dec_4bit_bytealigned_ls_dtype):
366 supportPL1 (cplx_flt_dec_4bit_bytealigned_dtype):
367 go to SUPPORTED_PL1_yes;
368
369 supportPL1 (real_fix_dec_9bit_ls_overp_dtype):
370 supportPL1 (real_fix_dec_9bit_ts_overp_dtype):
371 supportPL1 (real_fix_dec_9bit_uns_dtype):
372 supportPL1 (real_fix_dec_9bit_ts_dtype):
373 supportPL1 (real_fix_dec_4bit_uns_dtype):
374 supportPL1 (real_fix_dec_4bit_ts_dtype):
375 supportPL1 (real_fix_dec_4bit_bytealigned_uns_dtype):
376 supportPL1 (real_fix_dec_4bit_ls_dtype):
377 supportPL1 (real_flt_dec_4bit_dtype):
378 go to SUPPORTED_PL1_no;
379
380 SUPPORTED_PL1_yes:
381 return("1"b);
382
383 SUPPORTED_PL1_no:
384 return("0"b);
385
386 end supported_by_pl1_dtype;
387 %page;
388 pl1_dtype_name:
389 proc (dtype) returns (char(52) var);
390
391 dcl dtype fixed bin;
392
393 dcl CPLX_FLOAT_DEC_UNAL fixed bin aligned int static options(constant) init(cplx_flt_dec_4bit_bytealigned_dtype);
394
395
396
397 if dtype <= 0 | dtype > CPLX_FLOAT_DEC_UNAL then go to NOT_PL1_DTYPE;
398
399 dcl subscriptrange condition;
400 on subscriptrange begin;
401 go to NOT_PL1_DTYPE;
402 end;
403 go to dn(dtype);
404
405 dn( 1): return ("real_fix_bin_1_dtype");
406 dn( 2): return ("real_fix_bin_2_dtype");
407 dn( 3): return ("real_flt_bin_1_dtype");
408 dn( 4): return ("real_flt_bin_2_dtype");
409 dn( 5): return ("cplx_fix_bin_1_dtype");
410 dn( 6): return ("cplx_fix_bin_2_dtype");
411 dn( 7): return ("cplx_flt_bin_1_dtype");
412 dn( 8): return ("cplx_flt_bin_2_dtype");
413 dn( 9): return ("real_fix_dec_9bit_ls_dtype");
414 dn(10): return ("real_flt_dec_9bit_dtype");
415 dn(11): return ("cplx_fix_dec_9bit_ls_dtype");
416 dn(12): return ("cplx_flt_dec_9bit_dtype");
417 dn(13): return ("pointer_dtype");
418 dn(14): return ("offset_dtype");
419 dn(15): return ("label_dtype");
420 dn(16): return ("entry_dtype");
421 dn(17): return ("structure_dtype");
422 dn(18): return ("area_dtype");
423 dn(19): return ("bit_dtype");
424 dn(20): return ("varying_bit_dtype");
425 dn(21): return ("char_dtype");
426 dn(22): return ("varying_char_dtype");
427 dn(23): return ("file_dtype");
428 dn(33): return ("real_fix_bin_1_uns_dtype");
429 dn(34): return ("real_fix_bin_2_uns_dtype");
430 dn(43): return ("real_fix_dec_4bit_bytealigned_ls_dtype");
431 dn(44): return ("real_flt_dec_4bit_bytealigned_dtype");
432 dn(45): return ("cplx_fix_dec_4bit_bytealigned_ls_dtype");
433 dn(46): return ("cplx_flt_dec_4bit_bytealigned_dtype");
434
435 dn(24): return ("label_constant_runtime_dtype");
436 dn(25): return ("int_entry_runtime_dtype");
437 dn(26): return ("ext_entry_runtime_dtype");
438 dn(27): return ("ext_procedure_runtime_dtype");
439 dn(28): return ("NOT_SUPPORTED");
440 dn(29): return ("real_fix_dec_9bit_ls_overp_dtype");
441 dn(30): return ("real_fix_dec_9bit_ts_overp_dtype");
442 dn(31): return ("NOT_SUPPORTED");
443 dn(32): return ("NOT_SUPPORTED");
444
445 dn(35): return ("real_fix_dec_9bit_uns_dtype");
446 dn(36): return ("real_fix_dec_9bit_ts_dtype");
447 dn(37): return ("NOT_SUPPORTED");
448 dn(38): return ("real_fix_dec_4bit_uns_dtype");
449 dn(39): return ("real_fix_dec_4bit_ts_dtype");
450 dn(40): return ("real_fix_dec_4bit_bytealigned_uns_dtype");
451 dn(41): return ("real_fix_dec_4bit_ls_dtype");
452 dn(42): return ("real_flt_dec_4bit_dtype");
453
454 NOT_PL1_DTYPE:
455 return ("NOT_SUPPORTED");
456
457 end pl1_dtype_name;
458
459
460