1
2
3
4 try_assign:
5 if tdl.train_number = -2 then do;
6 pnum = substr(page_no_char,tdl.pageno,1);
7 call ioa_$rsnnl("^/^
8
9
10
11
12
13
14
15
16 tape_info.usage_time = 0;
17 tape_info.wait_time = 0;
18 tape_info.system_flag = "0"b;
19 tape_info.tracks = 0;
20 tape_info.device_name = tdl.device_name;
21 if substr(tdl.device_name,1,3) = "dsk" then do;
22 disk_info_ptr = addr(rcp_area);
23 rcp_name = "disk";
24 disk_info.volume_name = string("t&d scratch");
25 disk_info.write_flag = "1"b;
26 disk_info.version_num = 1;
27 disk_info.usage_time = 0;
28 disk_info.wait_time = 0;
29 disk_info.system_flag = "0"b;
30 disk_info.device_name = string(tdl.device_name);
31 end;
32 if substr(tdl.device_name,1,3) = "tap" then do;
33 rcp_name = "tape";
34 tape_info.volume_name = string("scratch");
35 tape_info.write_flag = "1"b;
36 end;
37 if substr(tdl.device_name,1,3) = "prt" then rcp_name = "printer";
38 if substr(tdl.device_name,1,3) = "pun" then rcp_name = "punch";
39 if substr(tdl.device_name,1,3) = "rdr" then rcp_name = "reader";
40 if substr(tdl.device_name,1,3) = "opc" then rcp_name = "console";
41
42
43 attach_loop:
44 if rcp_name = "disk" then
45 call rcp_priv_$attach(string (rcp_name),disk_info_ptr,tdl.status_event,"T&D is attaching "||tdl.device_name,
46 tdl.rcp_id,error);
47 else
48 call rcp_priv_$attach(string (rcp_name),tape_info_ptr,tdl.status_event,"T&D is attaching "||tdl.device_name,
49 tdl.rcp_id,error);
50 if error = 0 then goto attach_ok;
51 call com_err_$convert_status_code_(error,shortinfo,longinfo);
52 call ioa_$rsnnl("^/ioi_assign error
53 ,term_reason,output_length,longinfo);
54 call set_polts_abort(term_reason);
55 goto main_dispatch_queue_service;
56
57
58 attach_ok:
59 if tdl.allocated ^=0 then goto main_dispatch_queue_service;
60 if tdl.stop ^= 0 then do;
61 tdl.force = 1;
62 goto alloc_end_page;
63 end;
64 tdl.lst,tdl.trycnt = -1;
65
66 call assign(tdp,tip,tdl.asgn_flag);
67 tdl.io_dispatch = attach_ok;
68 if tdl.asgn_flag = 4|tdl.asgn_flag = 1|tdl.asgn_flag = 2 then if tdl.nxt = 0 then do;
69 pnum = substr(page_no_char,tdl.pageno,1);
70 if tdl.asgn_flag = 4 then call ioa_$rsnnl("^/^
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 tdl.clock_dispatch = attach_loop;
95 tdl.clock_going = 1;
96 call timer_manager_$alarm_wakeup(1000000,"10"b,tdl.clock_event);
97
98
99 goto main_dispatch_queue_service;
100
101
102 init_alloc:
103 tdl.allocated = 1;
104 goto select_next_test_or_seg_or_start_or_end;
105
106
107
108
109
110
111
112
113
114 eoline:
115 tdl.tdlret = eoline_do_return;
116 goto do;
117
118
119 eoline_do_return:
120 if tst.linetab(tdl.line_number+2) ^= 0 then do;
121 inv_data = "end of line sequencing would proceed on a non-tdl line";
122 goto say_invalid_instruction;
123 end;
124
125
126 tdl.line_number = tdl.line_number + 1;
127 goto nxlin;
128
129
130 skipf:
131 call isol;
132 if isol_flag = 1 then goto isol_er;
133 if isol_flag = 0 then goto eoline;
134 call look_up_mnemonic;
135 call bump_per_op_number_if_per_op;
136 goto nxfld;
137
138
139 fldct:
140 tdl.next_field_number,tdl.per_op_number = 0;
141 do dovar3 = 1 to skip_field_no;
142 call isol;
143 if isol_flag = 0 then goto eoline;
144 if isol_flag = 1 then goto isol_er;
145 call look_up_mnemonic;
146 call bump_per_op_number_if_per_op;
147 end;
148 goto nxfld;
149
150
151 nxlin:
152 if tst.linetab(tdl.line_number+1) ^= 0 then do;
153 term_message = "
154 tdl implimentation error-non tdl line at ""nxlin""";
155 call set_polts_abort(term_message);
156 goto main_dispatch_queue_service;
157
158 end;
159
160
161 tdl.tlscan = (tdl.line_number*56)+1;
162 tdl.next_field_number,tdl.per_op_number = 0;
163
164
165 nxfld:
166 if tdl.tmiflg = 0 then goto skip_do;
167 tdl.tdlret = skip_do;
168 goto do;
169
170
171 skip_do:
172 call isol;
173 if isol_flag = 2 then goto isol_ok;
174 if isol_flag = 0 then goto eoline;
175
176
177
178
179
180
181 isol_er:
182 inv_data = "> 6 alpha or >12 numbers";
183 goto say_invalid_instruction;
184
185
186
187
188
189
190
191 bump_per_op_number_if_per_op:proc;
192 if substr(inst$tdlr_type_conv_control((dovar1-1)*12+23),3,1) ="1"b then
193 tdl.per_op_number = tdl.per_op_number + 1;
194 end bump_per_op_number_if_per_op;
195
196
197 look_up_mnemonic:proc;
198 do dovar1 = 1 to inst$tlen/2 by 2;
199 if tdl.talpha = inst$tdli(dovar1) then return;
200 end;
201 inv_data = "unknown mnemonic";
202 goto say_invalid_instruction;
203 end look_up_mnemonic;
204
205
206 isol_ok:
207 call look_up_mnemonic;
208
209
210
211
212
213
214
215
216
217
218
219
220 tdl.inst_index = dovar1;
221 if substr(inst$tdlr_type_conv_control((dovar1-1)*12+23),4,1) ^="1"b then goto no_do;
222 tdl.tdlret = do_return;
223 goto do;
224
225
226 do_return:
227 dovar1 = tdl.inst_index;
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318 Note
319
320
321
322
323
324
325 Note
326
327
328
329
330
331
332
333
334
335 no_do:
336 call bump_per_op_number_if_per_op;
337 if inst$tdlr_num_conv_control((dovar1-1)*12+19)+
338 inst$tdlr_num_conv_control((dovar1-1)*12+20)+
339 inst$tdlr_num_conv_control((dovar1-1)*12+21) >tdl.tnmwrd
340 then do;
341 inv_data = "insufficient fixed numerics";
342 goto say_invalid_instruction;
343 end;
344
345
346 if inst$tdlr_num_conv_control((dovar1-1)*12+19)+
347 inst$tdlr_num_conv_control((dovar1-1)*12+20)+
348 inst$tdlr_num_conv_control((dovar1-1)*12+21)+
349 inst$tdlr_num_conv_control((dovar1-1)*12+22) < tdl.tnmwrd
350 then do;
351 inv_data = "more numerics than defined for instruction";
352 goto say_invalid_instruction;
353 end;
354
355
356 fdec1,fdec2,fdec3,vdec4,octnum = 0;
357 if substr(inst$tdlr_type_conv_control((dovar1-1)*12+23),6,1) ="1"b then goto octal_conversion;
358 vdec4 = inst$tdlr_num_conv_control((dovar1-1)*12+19)+
359 inst$tdlr_num_conv_control((dovar1-1)*12+20)+
360 inst$tdlr_num_conv_control((dovar1-1)*12+21)+1;
361 vdec4 = fixed(substr(tdl.tnmbr,vdec4));
362 fdec1 = fixed(substr(tdl.tnmbr,1,inst$tdlr_num_conv_control((dovar1-1)*12+19)));
363 fdec2 = fixed(substr(tdl.tnmbr,inst$tdlr_num_conv_control((dovar1-1)*12+19)+1,
364 inst$tdlr_num_conv_control((dovar1-1)*12+20)));
365 fdec3 = fixed(substr(tdl.tnmbr,inst$tdlr_num_conv_control((dovar1-1)*12+19)+
366 inst$tdlr_num_conv_control((dovar1-1)*12+20)+1,
367 inst$tdlr_num_conv_control((dovar1-1)*12+21)));
368 goto num_conv_done;
369
370
371 octal_conversion:
372 if tdl.tnmwrd = 0 then goto num_conv_done;
373 if search(tdl.tnmbr,"89") ^=0 then do;
374 inv_data ="only octal numerics allowed";
375 goto say_invalid_instruction;
376 end;
377
378
379 do dovar3 = 1 to 12;
380 if tdl.tnmwrd <dovar3 then goto left_justify;
381 octnum = octnum*8 + binary(substr(tdl.tnmbr,dovar3,1));
382 goto justify_done;
383
384
385 left_justify:
386 if substr(inst$tdlr_type_conv_control((dovar1-1)*12+23),5,1) ="1"b then goto num_conv_done;
387 octnum = octnum*8;
388 justify_done:
389 end;
390
391
392 num_conv_done:
393 tdl.tdlret = nxfld;
394 if pdata.simulation = 0 then goto no_bump;
395 inst$tdlr_no((dovar1-1)*4+5)= mod(inst$tdlr_no((dovar1-1)*4+5)+1,65536);
396
397
398
399 no_bump:
400 goto tdlr(inst$tdlr_no((dovar1-1)*4+6));
401
402
403 say_end_page:
404 tdl.cyccnt = tdl.cyccnt + 1;
405
406
407 alloc_end_page:
408 pnum = substr(page_no_char,tdl.pageno,1);
409 page_term = "normal";
410 if tdl.force ^=0 then page_term = "forced";
411 call ioa_$rsnnl("^/^
412
413
414
415
416
417
418
419
420
421
422
423
424 call buffer_tty_output(message,tdl.pageno);
425 goto main_dispatch_queue_service;
426
427
428
429 isol:proc;
430
431
432
433
434
435
436
437 tdl.topfld = tdl.next_field_number;
438
439 isol_flag = 0;
440 dovar1 = 1;
441 if lines(tdl.tlscan) = " " then goto isol_er_return;
442 if lines(tdl.tlscan) = "," then goto isol_er_return;
443 tdl.tnmbr = "";
444 tdl.talpha = "";
445 tdl.next_field_number = tdl.next_field_number + 1;
446 do dovar1 = 1 to 19;
447 if lines(tdl.tlscan+dovar1-1) = " " then goto break_char;
448 if lines(tdl.tlscan+dovar1-1) = "," then goto break_char;
449 if lines(tdl.tlscan+dovar1-1) <"0" then goto tis_alpha;
450 if lines(tdl.tlscan+dovar1-1) > "9" then goto tis_alpha;
451 if length(tdl.tnmbr) = 12 then goto length_error;
452 tdl.tnmbr = tdl.tnmbr||lines(tdl.tlscan+dovar1-1);
453 goto tis_number;
454
455
456 tis_alpha:
457 if length(tdl.talpha) = 6 then goto length_error;
458 tdl.talpha = tdl.talpha||lines(tdl.tlscan+dovar1-1);
459
460
461 tis_number:
462 end;
463
464
465 length_error:
466 isol_flag = 1;
467 goto isol_er_return;
468
469
470 break_char:
471 tdl.tnmwrd = length(tdl.tnmbr);
472 isol_flag = 2;
473
474
475 isol_er_return:
476 tdl.tlscan = tdl.tlscan+dovar1;
477 end isol;
478
479
480 do:
481 lpprct = lpprct + 1;
482 if lpprct <275 then goto no_tdl_loop;
483 inv_data = "tdl language lockup fault, no io for 275 major instructions";
484 goto say_invalid_instruction;
485
486
487 no_tdl_loop:
488 if chgmode = 0 then goto tdl.tdlret;
489 if chgmode >0 then goto set_up_io;
490 tdl.tdatas = tdl.tdata;
491 tdl.tpmb.op_code = tdl.tpmbs.op_code;
492 tdl.tdcws.wc = fixed(tio.tdcw.wc);
493 tdl.tadwds = tio.tadwd;
494 tdl.tdtyps = tdl.tdtyp;
495 tdl.tcwdls = tdl.tcwdl;
496 tdl.testas = tdl.testat;
497 chgmode = 0;
498 goto tdl.tdlret;
499
500
501 set_up_io:
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518 NOTE
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536 NOTE
537
538
539
540
541 tdl.terflg,tdl.tinint = 0;
542 if tdl.tcwdl ^=0 then goto skip_data_setup;
543 call lset;
544 if tdl.topcd.op_type = 0|tdl.tdtyp = 0 then goto skip_data_setup;
545 if tdl.tdtyp <1|tdl.tdtyp >10 then goto io_data_type_illegal;
546 goto io_setup_data(tdl.tdtyp);
547
548
549 io_data_type_illegal:
550 term_message ="
551 tdl.tdtyp > 10 in set_up_io";
552 call set_polts_abort(term_message);
553 goto main_dispatch_queue_service;
554
555
556
557 io_setup_data(1):
558 if tdl.topcd.op_type =1 then call setup_random_data;
559 goto skip_data_setup;
560
561
562 io_setup_data(2):
563 if tdl.topcd.op_type = 1 then tio.tdcw.add = rel(addr(tio.trarea));
564 goto skip_data_setup;
565
566
567 io_setup_data(3):
568 call setup_octal_data;
569 goto skip_data_setup;
570
571
572 io_setup_data(4):
573 if tdl.tdtyps =4 then tdl.tdtyps = 0;
574 call setup_add_to_data;
575 goto skip_data_setup;
576
577
578 io_setup_data(5):
579 call setup_data_from_line;
580 goto skip_data_setup;
581
582
583 io_setup_data(6):
584 if tdl.tdtyps =6 then tdl.tdtyps = 0;
585 call setup_drot;
586 goto skip_data_setup;
587
588
589 io_setup_data(10):
590 if tdl.tdtyps =10 then tdl.tdtyps = 0;
591 call setup_adrot;
592 goto skip_data_setup;
593
594
595 io_setup_data(8):
596 call setup_packed_hex_data;
597 goto skip_data_setup;
598
599
600 io_setup_data(9):
601 call setup_unpacked_hex_data;
602
603
604 io_setup_data(7):
605 skip_data_setup:
606 if cmpflg ^=0 then goto io_setup_cmp;
607 if tdl.topcd.op_type ^= 3 then goto check_for_ram;
608
609 if tdl.tcwdl ^=0 then goto check_for_ram;
610 call lset;
611 do dovar1 = 1 to tdl.tdtcal_wc+1;
612 tio.trarea(dovar1) = tdl.tpadwd;
613 end;
614 tio.redpre = tdl.tpadwd;
615
616
617 check_for_ram:
618 if tdl.tmiflg ^= 0 then go to io_setup_cmp;
619
620 if tdl.dual_io_device = 0 then goto io_setup_cmp;
621 if (tdl.do_dual_io = 1) & (tdl.dual_io_count = 0) then goto io_setup_cmp;
622 if (tdl.do_dual_io = 0) & (tdl.dual_io_count = 0) then goto save_first_of_dual;
623 if (tdl.do_dual_io = 0) & (tdl.dual_io_count = 1) then goto io_setup_cmp;
624 inv_data = "inconsistant dual io command setup";
625 goto say_invalid_instruction;
626
627
628
629
630 save_first_of_dual:
631 tio.tskpmb = tdl.tpmb.op_code||tdl.tpmb.dev||"0000001110000"b||
632 tdl.tpmb.iom_cmd||"0"b||tdl.tpmb.reccnt;
633 tio.tsdcwv = tio.tdcw;
634 tdl.dual_io_count = 1;
635 chgmode = 0;
636 goto tdl.tdlret;
637
638
639
640
641
642
643 io_setup_cmp:
644 if tdl.tdtyp ^=7 then goto io_setup_trace_dcws;
645 if tdl.tpmb.iom_cmd ^= "0100"b then do;
646 inv_data = "wrong ioc command used with ""loc"" data type";
647 goto say_invalid_instruction;
648 end;
649 tdl.tpmb.reccnt = substr(tdl.tdata,31,6);
650
651
652 io_setup_trace_dcws:
653 chgmode = 0;
654 continue,allow_branch_dcw,dcw_count,fmtflg = 0;
655 current_dcw_add = tdl.tfdcwp;
656 if (dual_io_device = 1) & (tdl.tpmb.op_code = "001111"b) then
657 fmtflg = 1;
658
659
660 get_next_dcw:
661 tdl.tldcw = current_dcw_add->dcw_peek;
662 dcw_count = dcw_count +1;
663 dcw_list.dcws(dcw_count) = tdl.tldcw;
664 current_dcw_add = addrel(current_dcw_add,1);
665 if dcw_count > 10 then goto say_dcw_loop;
666 if tdl.tldcw.char = "111"b then goto trace_idcw;
667 if tdl.tldcw.typ = "00"b then goto trace_stop_dcw;
668 if tdl.tldcw.typ = "01"b then goto trace_proceed_dcw;
669 if tdl.tldcw.typ = "10"b then goto trace_branch_dcw;
670
671
672
673 trace_proceed_dcw:
674 if fmtflg = 1 then do;
675 call set_hbs_bit;
676 end;
677 allow_branch_dcw = 1;
678 goto get_next_dcw;
679
680
681 trace_branch_dcw:
682 if allow_branch_dcw = 0 then goto say_branch_bad;
683 allow_branch_dcw = 0;
684 current_dcw_add = addrel(tip,fixed(tdl.tldcw.add));
685 goto get_next_dcw;
686
687
688 trace_stop_dcw:
689 if fmtflg = 1 then do;
690 call set_hbs_bit;
691 end;
692 if continue = 1 then do;
693 continue = 0;
694 goto get_next_dcw;
695 end;
696 if cmpflg ^=0 then go to error_check;
697 if tdl.trace = 0 then goto issue_test_io;
698 tdl.ttyret = issue_test_io;
699 call output_trace(tdp,tip,dcw_count,addr(dcw_list.dcws));
700 goto main_dispatch_queue_service;
701
702
703
704 trace_idcw:
705 allow_branch_dcw = 0;
706 if substr(tdl.tldcw.typ,1,1) = "1"b then continue = 1;
707 goto get_next_dcw;
708
709
710 issue_test_io:
711 tdl.interrupts.term = "0"b;
712 tdl.interrupts.init = "0"b;
713 tdl.interrupts.spec = "0"b;
714 tdl.interrupts.falt = "0"b;
715 tdl.interrupts.timeout = "0"b;
716 tdl.gespec = 0;
717 lpprct = 0;
718 tdl.test_io_cnt = tdl.test_io_cnt + 1;
719
720 tio.tpcw = tdl.tpmb.op_code||tdl.tpmb.dev||"0000001110000"b||
721 tdl.tpmb.iom_cmd||"0"b||tdl.tpmb.reccnt;
722 note
723 tio_off = fixed(rel(tdl.tfdcwp));
724 if tdl.com_per_flag ^=0 then do;
725 pcwa = "000000000000000000111000000000000000"b ;
726 if tdl.tpxdio ^=0 then goto aye_o_go;
727 substr(tio.ttdcw,19,18) = "000010000000000000"b;
728 substr(tio.ttdcw,1,18) = rel(tdl.tfdcwp);
729 tio_off = fixed(rel(addr(tio.tpcw)));;
730 goto aye_o_go;
731 end;
732
733 pcwa = tio.tpcw;
734 aye_o_go:
735
736 if (tdl.dual_io_device = 1) & (tdl.dual_io_count = 1) then do;
737 tio_off = fixed(rel(addr(tio.tskpmb)));
738 tio.tskpmb = substr(tio.tskpmb,1,22)||"1"b||substr(tio.tskpmb,24,13);
739 tdl.dual_io_count = 0;
740 end;
741
742
743
744
745 tdl.io_in_progress = 1;
746 tdl.io_dispatch = page_reentry;
747 if pdata.simulation = 1 then goto sim_connect;
748 call ioi_$connect_pcw(tdl.device_index,tio_off,pcwa,error);
749 tdl.do_dual_io = 0;
750 if error ^=0 then goto aye_o_error;
751 goto main_dispatch_queue_service;
752
753
754 sim_connect:
755 call sioi_$connect_pcw(tdl.device_index,tio_off,pcwa,error);
756 if error = 0 then goto main_dispatch_queue_service;
757
758
759 aye_o_error:
760 call com_err_$convert_status_code_(error,shortinfo,longinfo);
761 call ioa_$rsnnl("^/io connect error on page ^a^/^a",
762 term_reason,output_length,tst.name,longinfo);
763 call set_polts_abort(term_reason);
764 goto main_dispatch_queue_service;
765
766
767 gespec_timeout:
768
769 tdl.io_in_progress = 0;
770 tdl.interrupts.timeout = "1"b;
771
772
773 page_reentry:
774 goto error_check;
775
776
777 say_dcw_loop:
778 inv_data = "use of tdcw (cwxby) has caused dcw string loop without iotd (cwxs)";
779 goto say_invalid_instruction;
780
781
782 say_branch_bad:
783 inv_data = "illegal use of tdcw (cwxby), two tdcws in a row";
784 goto say_invalid_instruction;
785
786
787 error_check:
788 pos = "";
789 if (tdl.tpxdio = 0)&(tdl.eep_tally = 0) then goto not_xdio;
790 tdl.tpxdio = 0;
791
792 if (bool(string(status),"111111000000010001111111000000000000"b,"0001"b)
793 = "100000000000000000000000000000000000"b)&
794 (tdl.interrupts.timeout = "0"b)&(tdl.interrupts.falt = "0"b)
795 then goto tdl.tdlret;
796 if tdl.interrupts.falt = "1"b then
797 call ioa_$rsnnl("^/iom fault ^w",
798 inv_data,mesg_len,addr(tdl.status)->falt_peek);
799 if tdl.interrupts.timeout = "1"b then do;
800 if tdl.gespec = 0 then
801 inv_data = "
802 io timeout on connect";
803 if tdl.gespec ^= 0 then
804 inv_data = "
805 io timeout waiting for special";
806 end;
807 tdl.interrupts.falt,
808 tdl.interrupts.timeout = "0"b;
809 tdl.gespec = 0;
810 if tdl.eep_in_progress ^=0 then goto report_eep_error;
811 call ioa_$rsnnl("^/^
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826 report_eep_error:
827 call ioa_$rsnnl("^/extended status unreadable^/status was ^12w"||inv_data,
828 message,mesg_len,
829 addr(tdl.status)->falt_peek);
830 message = tdl.eep_msg||message;
831 goto post_eep_com;
832
833
834 post_eep_err:
835 tdl.eep_tally = 0;
836 tdl.eep_in_progress = 0;
837 tdl.tflag(10) = 0;
838 tdl.do_opt = 1;
839 tdl.optrtn = end_page;
840 goto process_options;
841
842
843 not_xdio:
844 if (tdl.interrupts.falt = "1"b)|(tdl.interrupts.timeout = "1"b) then do;
845 tdl.terflg = 1;
846 tdl.interrupts.term = "0"b;
847 tdl.interrupts.spec = "0"b;
848 tdl.interrupts.init = "1"b;
849 end;
850 cmpflg,tdl.tdecnt = 0;
851 tdl.tesmb.add = bit(fixed(fixed(tdl.tldcw.add)+fixed(tdl.tldcw.wc) + tdl.absaddr
852 ,length(tdl.tesmb.add)),length(tdl.tesmb.add));
853 if tdl.tpsflg = 0 then goto check_status_and_interrupts;
854 if tdl.tpmb.op_code = "00"b then goto check_status_and_interrupts;
855
856 if fixed(tdl.tpmb.op_code) >31 then goto not_read_or_write;
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871 wef_command:
872 if tdl.interrupts.init ^= "1"b then
873
874
875 tdl.tppos = tdl.tppos + 1;
876 goto check_status_and_interrupts;
877
878
879 not_read_or_write:
880 if tdl.tpmb.op_code = "100101"b|tdl.tpmb.op_code = "100111"b then
881 goto use_explicit_position;
882 if tdl.tpmb.op_code = "100100"b then goto add_record_count;
883 if tdl.tpmb.op_code = "100110"b then goto sub_record_count;
884 if tdl.tpmb.op_code = "111000"b|
885 tdl.tpmb.op_code = "111010"b|
886 tdl.tpmb.op_code = "111101"b then goto set_initial;
887 if tdl.tpmb.op_code = "101101"b then goto wef_command;
888 goto check_status_and_interrupts;
889
890 set_initial:
891 tdl.tppos = 0;
892 goto check_status_and_interrupts;
893
894 add_record_count:
895 if tdl.interrupts.init = "1"b then goto check_status_and_interrupts;
896 tdl.tppos = tdl.tppos + fixed(tdl.tpmb.reccnt);
897 goto check_status_and_interrupts;
898
899 sub_record_count:
900 if tdl.interrupts.init = "1"b then goto check_status_and_interrupts;
901 tdl.tppos = tdl.tppos - fixed(tdl.tpmb.reccnt);
902 goto check_status_and_interrupts;
903
904 use_explicit_position:
905
906
907
908 if tdl.interrupts.init ^= "1"b then
909 tdl.tppos = tdl.tppos_save;
910 goto check_status_and_interrupts;
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984 check_status_and_interrupts:
985 if tdl.status.iocstat ^= "000000"b then tdl.terflg = 1;
986 if tdl.interrupts.term ^= tdl.testat.expected_interrupts.term then goto interrupts_error;
987 if tdl.interrupts.init ^= tdl.testat.expected_interrupts.init then goto interrupts_error;
988 goto interrupts_ok;
989
990
991
992
993 interrupts_error:
994 tdl.terflg = 1;
995
996
997 interrupts_ok:
998 if tdl.status.major_status ^= tdl.testat.major_status then
999 tdl.terflg = 1;
1000 if tdl.testat.ignore_ss ^="0"b then goto sub_status_ok;
1001 if tdl.status.sub_status ^= tdl.testat.sub_status then
1002 tdl.terflg = 1;
1003
1004
1005
1006 sub_status_ok:
1007 if tdl.interrupts.init ="0"b then goto no_init_int_occured;
1008 tdl.tinint = 1;
1009 goto check_non_data_io;
1010
1011
1012 no_init_int_occured:
1013 if tdl.tnrflg =0 then goto check_non_data_io;
1014 if tdl.status.rrc ^= tdl.trrec then
1015 tdl.terflg = 1;
1016
1017
1018
1019 check_non_data_io:
1020 if tdl.topcd.op_type = 0 then goto error_check_done;
1021 if tdl.tpmb.iom_cmd ^= "0100"b then goto not_sing_char_ioc_cmd;
1022 goto error_check_done;
1023
1024
1025 not_sing_char_ioc_cmd:
1026 if tdl.tinint ^= 0 then goto error_check_done;
1027 if tdl.tnmflg ^= 0 then goto check_read;
1028 if tdl.tnrflg = 0 then goto check_res_wc;
1029 goto check_res_add;
1030
1031
1032 check_res_wc:
1033 if tdl.dcwres.wrd = tdl.trwrd then goto check_res_add;
1034 if (tdl.trwrd = "000000000000"b|
1035 tdl.topcd.op_type = 3) = "0"b then goto check_read;
1036 tdl.terflg = 1;
1037
1038
1039 check_res_add:
1040 if tdl.dcwres.wrd ^="000000000000"b then goto check_read;
1041 if tdl.tesmb.add = tdl.dcwres.add then goto check_read;
1042 tdl.terflg = 1;
1043
1044
1045 check_read:
1046 if tdl.topcd.op_type ^=3|
1047 tdl.tncflg ^=0 then goto error_check_done;
1048 current_dcw_add = tdl.tfdcwp;
1049 tdl.tldcw = current_dcw_add->dcw_peek;
1050
1051 if tdl.tdtyp ^=1 then goto dont_initialize_random;
1052 dvran = addrel(tip,tdl.tldcw.add)->data_peek.data;
1053 if fixed(tdl.tdata) ^= 0 then
1054 dvran = tio.tadwd;
1055 if tdl.tpsflg = 0 then goto no_pos_check;
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083 dvran = bool(bit(fixed(tdl.tppos,18),18),"111111111111111111"b,"1100"b)||bit(fixed(tdl.tppos,18),18);
1084 if (tdl.tldcw.typ = "00"b|tdl.tldcw.typ = "01"b) = "0"b then goto no_pos_check;
1085
1086 if substr(addrel(tip,tdl.tldcw.add)->data_peek.data,1,18) = substr(dvran,1,18)|
1087 substr(addrel(tip,tdl.tldcw.add)->data_peek.data,19,18) = substr(dvran,19,18)
1088 then goto position_good;
1089 if substr(addrel(tip,tdl.tldcw.add)->data_peek.data,1,18) =
1090 bool(substr(addrel(tip,tdl.tldcw.add)->data_peek.data,19,18),"111111111111111111"b,"1100"b)
1091 then goto position_error;
1092
1093 pos = "
1094 goto no_pos_check;
1095
1096
1097 position_error:
1098 pos = translate(substr(character(tdl.tppos),
1099 length(character(tdl.tppos))-2),"0"," ");
1100 tdl.tppos = fixed(substr(addrel(tip,tdl.tldcw.add)->data_peek.data,19,18));
1101 dvran = bool(bit(fixed(tdl.tppos,18),18),"111111111111111111"b,"1100"b)||bit(fixed(tdl.tppos,18),18);
1102
1103 tdl.terflg = 1;
1104 goto no_pos_check;
1105
1106
1107 position_good:
1108 pos = "ok ";
1109 no_pos_check:
1110
1111
1112
1113
1114
1115
1116
1117 dont_initialize_random:
1118 allow_branch_dcw,dcw_count = 0;
1119
1120
1121 select_next_dcw:
1122 tdl.tldcw = current_dcw_add->dcw_peek;
1123 dcw_count = dcw_count +1;
1124 current_dcw_add = addrel(current_dcw_add,1);
1125 if dcw_count > 10 then goto say_dcw_loop;
1126
1127 if tdl.tldcw.typ = "00"b then goto check_stop_dcw;
1128 if tdl.tldcw.typ = "01"b then goto check_proceed_dcw;
1129 if tdl.tldcw.typ = "10"b then goto check_branch_dcw;
1130
1131 goto check_ndt_and_proceed;
1132
1133
1134 check_proceed_dcw:
1135 call check_data;
1136 check_ndt_and_proceed:
1137 allow_branch_dcw = 1;
1138 goto select_next_dcw;
1139
1140
1141 check_branch_dcw:
1142 if allow_branch_dcw = 0 then goto say_branch_bad;
1143
1144 allow_branch_dcw = 0;
1145 current_dcw_add = addrel(tip,fixed(tdl.tldcw.add));
1146 goto select_next_dcw;
1147
1148
1149 check_stop_dcw:
1150 call check_data;
1151 goto error_check_done;
1152
1153
1154 check_data:proc;
1155 tdl.tdtcal_reladd = fixed(tdl.tldcw.add)
1156 - fixed(rel(addr(tio.trarea(1))));
1157 tdl.tdtcal_wc = fixed(tdl.tldcw.wc)-fixed(tdl.dcwres.wrd);
1158
1159 if tdl.tdtyp ^=1 then goto not_random_read;
1160 do dovar2 = 1 to tdl.tdtcal_wc;
1161 tio.twarea(tdl.tdtcal_reladd+dovar2) = dvran;
1162 call compute_random;
1163 end;
1164
1165
1166 not_random_read:
1167 do dovar1 = 1 to tdl.tdtcal_wc;
1168 if trarea(dovar1+tdl.tdtcal_reladd) = twarea(dovar1+tdl.tdtcal_reladd) then goto data_good;
1169 if tdl.tchmsk ^= "000000000000000000000000000000000000"b&
1170 tdl.tldcw.typ = "00"b&
1171 dovar1= tdl.tdtcal_wc then do;
1172 if bool(trarea(dovar1+tdl.tdtcal_reladd),tdl.tchmsk,"0010"b)
1173 = bool(twarea(dovar1+tdl.tdtcal_reladd),tdl.tchmsk,"0010"b) then goto data_good;
1174 end;
1175 tdl.tdecnt = tdl.tdecnt+1;
1176 data_good:
1177 end;
1178 end check_data;
1179
1180
1181
1182 error_check_done:
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194 if tdl.tntflg ^=0 then goto check_for_options_after_error_check;
1195 if (tdl.status.pwr ^= "0"b|tdl.status.major_status = "0010"b)
1196 ="0"b then goto not_man_intervention;
1197 if tdl.endng ^= 0 then goto not_man_intervention;
1198
1199 if tdl.status.pwr ^= "0"b then goto in_man_intervention;
1200 if tdl.status.major_status ^= tdl.testat.major_status
1201 then goto in_man_intervention;
1202
1203
1204 not_man_intervention:
1205 if tdl.tmiflg ^=0 then goto end_man_intervention;
1206 if tdl.trflg = 0 then goto no_tran_request;
1207
1208
1209
1210
1211
1212
1213
1214
1215 if tdl.terflg^=0|tdl.tdecnt ^=0 then goto transient_error;
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225 if tdl.topcd.op_type = 3 then do;
1226 tdl.pastrn.read = tdl.pastrn.read + tdl.trcnt;
1227 tdl.cyctrn.read = tdl.cyctrn.read + tdl.trcnt;
1228 tdl.tottrn.read = tdl.tottrn.read + tdl.trcnt;
1229 end;
1230 else do;
1231 tdl.pastrn.write = tdl.pastrn.write + tdl.trcnt;
1232 tdl.cyctrn.write = tdl.cyctrn.write + tdl.trcnt;
1233 tdl.tottrn.write = tdl.tottrn.write + tdl.trcnt;
1234 end;
1235 tdl.trcnt = 0;
1236 goto check_for_options_after_error_check;
1237
1238
1239 transient_error:
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250 if tdl.trycnt = 0 then goto no_tran_request;
1251
1252
1253
1254
1255
1256 tdl.trcnt = tdl.trcnt + 1;
1257 if tdl.trcnt >= tdl.trflg then goto unrecoverable;
1258 if tdl.traner = 0 then goto enter_transient_recovery;
1259
1260 tdl.tdlret = enter_transient_recovery;
1261 tdl.add_tran = 2;
1262 goto complete_transient_message;
1263
1264
1265 enter_transient_recovery:
1266 if tdl.topcd.op_type ^=3 then goto enter_write_recovery;
1267 if tst.linetab(tdl.tsubr+1) ^=0 then goto invalid_tran_line;
1268 tdl.line_number = tdl.tsubr;
1269 goto nxlin;
1270
1271
1272 enter_write_recovery:
1273 if tst.linetab(tdl.tsubw+1) ^=0 then goto invalid_tran_line;
1274 tdl.line_number = tdl.tsubw;
1275 goto nxlin;
1276
1277 invalid_tran_line:
1278 inv_data = "transient error recovery subroutine is a non_tdl line";
1279 goto say_invalid_instruction;
1280
1281
1282 unrecoverable:
1283 if tdl.topcd.op_type = 3 then do;
1284 tdl.pastrn.read = tdl.pastrn.read + tdl.trcnt;
1285 tdl.cyctrn.read = tdl.cyctrn.read + tdl.trcnt;
1286 tdl.tottrn.read = tdl.tottrn.read + tdl.trcnt;
1287 end;
1288 else do;
1289 tdl.pastrn.write = tdl.pastrn.write + tdl.trcnt;
1290 tdl.cyctrn.write = tdl.cyctrn.write + tdl.trcnt;
1291 tdl.tottrn.write = tdl.tottrn.write + tdl.trcnt;
1292 end;
1293 tdl.add_tran = 1;
1294 goto complete_transient_message;
1295
1296
1297 no_tran_request:
1298 if tdl.terflg = 0&tdl.tdecnt = 0 then goto check_for_options_after_error_check;
1299 tdl.toterr.sta = tdl.toterr.sta + tdl.terflg;
1300 tdl.cycerr.sta = tdl.cycerr.sta + tdl.terflg;
1301 tdl.paserr.sta = tdl.paserr.sta + tdl.terflg;
1302 tdl.toterr.dat = tdl.toterr.dat + tdl.tdecnt;
1303 tdl.cycerr.dat = tdl.cycerr.dat + tdl.tdecnt;
1304 tdl.paserr.dat = tdl.paserr.dat + tdl.tdecnt;
1305 tdl.taeflg = 1;
1306
1307
1308 complete_transient_message:
1309 if tdl.bypass ^=0 then goto check_for_options_after_error_check;
1310
1311
1312 man_intervention_started:
1313 tdl.ttyret = check_for_options_after_error_check;
1314 call error_output(tdp,pos);
1315 if tdl.teepopt ^=0&tdl.eep_line_no ^=0&tdl.tmiflg=0&tdl.endng = 0 then goto start_eep;
1316
1317 goto main_dispatch_queue_service;
1318
1319
1320
1321 start_eep:
1322 tdl.eep_in_progress = 1;
1323 tdl.eep_talpha = tdl.talpha;
1324 tdl.eep_tnmbr = tdl.tnmbr;
1325 tdl.eep_tnmwrd = tdl.tnmwrd;
1326 tdl.eep_next_field_number = tdl.next_field_number;
1327 tdl.eep_per_op_number = tdl.per_op_number;
1328 tdl.eep_line_number = tdl.line_number;
1329 tdl.eep_tlscan = tdl.tlscan;
1330 tdl.eep_inst_index = tdl.inst_index;
1331 tdl.eep_tdlret = tdl.tdlret;
1332 tdl.line_number = tdl.eep_line_no;
1333 goto nxlin;
1334
1335
1336 end_man_intervention:
1337 tdl.tmiflg = 0;
1338 goto restart;
1339
1340
1341 in_man_intervention:
1342 if tdl.tmiflg ^=0 then goto not_first_intervention;
1343 tdl.toterr.sta = tdl.toterr.sta + tdl.terflg;
1344 tdl.cycerr.sta = tdl.cycerr.sta + tdl.terflg;
1345 tdl.paserr.sta = tdl.paserr.sta + tdl.terflg;
1346 tdl.toterr.dat = tdl.toterr.dat + tdl.tdecnt;
1347 tdl.cycerr.dat = tdl.cycerr.dat + tdl.tdecnt;
1348 tdl.paserr.dat = tdl.paserr.dat + tdl.tdecnt;
1349 tdl.taeflg = 1;
1350 tdl.tmiflg = 1;
1351 goto man_intervention_started;
1352
1353
1354 not_first_intervention:
1355 tdl.tmiflg = tdl.tmiflg +1;
1356 if tdl.tmiflg >= 128 then goto reset_man_intervention;
1357
1358
1359 man_intervention_loop:
1360 tdl.tmnem = "res ";
1361 check = 32;
1362 goto per_op_common;
1363
1364
1365 reset_man_intervention:
1366 tdl.tmiflg = 1;
1367 goto man_intervention_started;
1368
1369
1370 check_for_options_after_error_check:
1371 if tdl.tmiflg ^=0 then goto man_inter_options;
1372 if tdl.opt = 0 then goto tdl.tdlret;
1373 tdl.optrtn = tdl.tdlret;
1374 goto process_options;
1375
1376
1377 man_inter_options:
1378 if tdl.opt = 0 then goto man_intervention_loop;
1379 tdl.optrtn = man_intervention_loop;
1380 goto process_options;
1381
1382
1383 setup_random_data:proc;
1384 if fixed(tdl.tdata) ^= 0 then
1385 dvran = tio.tadwd;
1386 if tdl.tpsflg ^=0 then
1387 dvran = bool(bit(fixed(tdl.tppos+1,18),18),"111111111111111111"b,"1100"b)||bit(fixed(tdl.tppos+1,18),18);
1388
1389
1390
1391
1392 not_pos_rand:
1393 do dovar1 = 1 to data_setup_wc;
1394 tio.twarea(data_setup_reladd+dovar1) = dvran;
1395 call compute_random;
1396 end;
1397
1398
1399
1400 end setup_random_data;
1401
1402
1403 setup_octal_data:proc;
1404 tdl.tdtyp = 0;
1405 do dovar1 = 1 to data_setup_wc;
1406 tio.twarea(data_setup_reladd+dovar1) = tdl.tdata;
1407 end;
1408 end setup_octal_data;
1409
1410
1411 setup_add_to_data:proc;
1412 tdl.tdtyp = 0;
1413 do dovar1 = 1 to data_setup_wc;
1414 tio.twarea(data_setup_reladd+dovar1)
1415 = bit(fixed((fixed(tdl.tdata) + fixed(tio.twarea(data_setup_reladd+dovar1))),36));
1416 end;
1417 end setup_add_to_data;
1418
1419
1420 setup_data_from_line:proc;
1421 tdl.tdtyp = 0;
1422 work_ptr = addrel(addr(tst.lines),(fixed(tdl.tdata)*14));
1423
1424
1425 note
1426
1427
1428
1429 do dovar1 = 1 to tdl.tdtcal_wc by 9;
1430 if tst.linetab(fixed(tdl.tdata)+(dovar1-1)/9+1) ^= 2 then goto not_test_data_line;
1431 end;
1432
1433
1434 fix_bit = 0;
1435 do dovar1 = 1 to tdl.tdtcal_wc;
1436 tio.twarea(data_setup_reladd+dovar1) = work_ptr->data_move.data(dovar1+fix_bit);
1437 if mod(dovar1,9) = 0 then fix_bit = fix_bit+5;
1438 end;
1439 end setup_data_from_line;
1440
1441
1442 not_test_data_line:
1443 inv_data = "dln data is not all from test data line";
1444 goto say_invalid_instruction;
1445
1446
1447 setup_drot:proc;
1448 tdl.tdtyp = 0;
1449 work_ptr = addrel(addr(twarea(1)),data_setup_reladd);
1450 substr(work_ptr->bit_look.data(1),1,(data_setup_wc*36))
1451 = substr(work_ptr->bit_look.data(1),7,(data_setup_wc*36-6))||
1452 substr(work_ptr->bit_look.data(1),1,6);
1453 end setup_drot;
1454
1455
1456 setup_adrot:proc;
1457 tdl.tdtyp = 0;
1458 work_ptr = addrel(addr(twarea(1)),data_setup_reladd);
1459 substr(work_ptr->bit_look.data(1),1,(data_setup_wc*36))
1460 = substr(work_ptr->bit_look.data(1),10,(data_setup_wc*36-9))||
1461 substr(work_ptr->bit_look.data(1),1,9);
1462 end setup_adrot;
1463
1464
1465 setup_packed_hex_data:proc;
1466 tdl.tdtyp = 0;
1467 work_ptr = addrel(addr(tst.lines),(fixed(tdl.tdata)*14));
1468
1469
1470 note
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484 do dovar1 = 1 to ceil((tdl.tdtcal_wc*9)/6) by 9;
1485 if tst.linetab(fixed(tdl.tdata)+(dovar1-1)/9+1) ^= 2 then goto not_test_data_line;
1486 end;
1487
1488
1489 fix_bit = 0;
1490 do dovar1 = 1 to tdl.tdtcal_wc*9;
1491 if hex_val(fixed(work_ptr->char6_peek(dovar1+fix_bit))+1) = 20 then goto invalid_hex_line;
1492 if mod(dovar1,54) = 0 then fix_bit = fix_bit+30;
1493 end;
1494
1495
1496 fix_bit = 0;
1497 do dovar1 = 1 to tdl.tdtcal_wc;
1498 tio.twarea(data_setup_reladd+dovar1) =
1499 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+1+fix_bit))+1),4),4)||
1500 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+2+fix_bit))+1),4),4)||
1501 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+3+fix_bit))+1),4),4)||
1502 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+4+fix_bit))+1),4),4)||
1503 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+5+fix_bit))+1),4),4)||
1504 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+6+fix_bit))+1),4),4)||
1505 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+7+fix_bit))+1),4),4)||
1506 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+8+fix_bit))+1),4),4)||
1507 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*9+9+fix_bit))+1),4),4);
1508 if mod(dovar1,6) = 0 then fix_bit = fix_bit+30;
1509 end;
1510 end setup_packed_hex_data;
1511
1512
1513 setup_unpacked_hex_data:proc;
1514 tdl.tdtyp = 0;
1515 work_ptr = addrel(addr(tst.lines),(fixed(tdl.tdata)*14));
1516
1517
1518 note
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534 do dovar1 = 1 to ceil((tdl.tdtcal_wc*8)/6) by 9;
1535 if tst.linetab(fixed(tdl.tdata)+(dovar1-1)/9+1) ^= 2 then goto not_test_data_line;
1536 end;
1537
1538
1539 fix_bit = 0;
1540 do dovar1 = 1 to tdl.tdtcal_wc*8;
1541 if hex_val(fixed(work_ptr->char6_peek(dovar1+fix_bit))+1) = 20 then goto invalid_hex_line;
1542 if mod(dovar1,54) = 0 then fix_bit = fix_bit+30;
1543 end;
1544
1545
1546 fix_bit = -30;
1547 do dovar1 = 1 to tdl.tdtcal_wc;
1548 if mod(dovar1,27) = 1 then fix_bit = fix_bit+30;
1549 byte1 =
1550 "0"b||
1551 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+1+fix_bit))+1),4),4)||
1552 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+2+fix_bit))+1),4),4);
1553 if mod(dovar1,27) = 21 then fix_bit = fix_bit+30;
1554 byte2 =
1555 "0"b||
1556 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+3+fix_bit))+1),4),4)||
1557 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+4+fix_bit))+1),4),4);
1558 if mod(dovar1,27) = 14 then fix_bit = fix_bit+30;
1559 byte3 =
1560 "0"b||
1561 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+5+fix_bit))+1),4),4)||
1562 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+6+fix_bit))+1),4),4);
1563 if mod(dovar1,27) = 7 then fix_bit = fix_bit+30;
1564 tio.twarea(data_setup_reladd+dovar1) =
1565 byte1||byte2||byte3||
1566 "0"b||
1567 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+7+fix_bit))+1),4),4)||
1568 bit(fixed(hex_val(fixed(work_ptr->char6_peek((dovar1-1)*8+8+fix_bit))+1),4),4);
1569 end;
1570 end setup_unpacked_hex_data;
1571
1572
1573 invalid_hex_line:
1574 inv_data = "invalid hexidecimal character in uhdln or phdln";
1575 goto say_invalid_instruction;
1576
1577
1578 compute_random:proc;
1579 dvranw = "0"b||bit(fixed(fixed(dvran)*317,71),71);
1580 dvran=substr(bit(fixed(fixed(substr(dvranw,37,36),36)+fixed(substr(dvranw,1,35),36),36),36),1,36);
1581 end compute_random;
1582
1583
1584
1585 page_initialize:
1586 call init_page;
1587 if tdl.initreq ^=-1 then goto select_next_test_or_seg_or_start_or_end;
1588 tdl.initreq = 0;
1589
1590
1591 start_test:
1592 tdl.lst = tdl.nxt;
1593 tdl.loopct(tdl.line_number+1),
1594 tdl.tpsflg,
1595 tdl.do_dual_io,
1596 tdl.second_io_of_dual,
1597 tdl.eep_tally,
1598 tdl.eep_in_progress,
1599 tdl.tmiflg = 0;
1600 tdl.tchmsk = "000000000000000000000000000000000000"b;
1601 tdl.tpadwd = "101010101010101010101010101010101010"b;
1602 goto nxlin;
1603
1604
1605 init_page:proc;
1606 tdl.tdtyps,tdl.tcwdls = 0;
1607 tdl.tdatas = "000000000000000000000000000000000000"b;
1608 tdl.tpmbs.chan = tdl.tpaddp;
1609 dvran = "001010011100101110110101100011010001"b;
1610 do dovar1 = 1 to 10;
1611 tio.tdcww(dovar1).add = rel(addr(tio.twarea));
1612 tio.tdcwr(dovar1).add = rel(addr(tio.trarea));
1613 tio.tdcww(dovar1).char = "000"b;
1614 tio.tdcwr(dovar1).char ="000"b;
1615 tio.tdcww(dovar1).w_c = "0"b;
1616 tio.tdcwr(dovar1).w_c = "0"b;
1617 tio.tdcww(dovar1).typ ="00"b;
1618 tio.tdcwr(dovar1).typ = "00"b;
1619 tio.tdcww(dovar1).wc = bit(fixed(tst.max,12),12);
1620 tio.tdcwr(dovar1).wc = bit(fixed(tst.max,12),12);
1621 end;
1622 tdl.tdcws.wc = tst.max;
1623 tio.tdcw.char ="000"b;
1624 tio.tdcw.w_c = "0"b;
1625 tio.tdcw.typ = "00"b;
1626 chgmode,
1627 tdl.terflg,
1628 tdl.taeflg,
1629 tdl.tcwdl,
1630 tdl.tpsflg = 0;
1631 do dovar1 = 1 to 101;
1632 tdl.loopct(dovar1) = 0;
1633 end;
1634 do dovar1 = 1 to 10;
1635 tdl.tsfld(dovar1) = -1;
1636 tdl.tscnt(dovar1) = 0;
1637 end;
1638 end init_page;
1639
1640
1641
1642 set_hbs_bit:proc;
1643 fmtflg = 0;
1644 substr(addrel(tip,tdl.tldcw.add)-> bits,34,1)= "1"b;
1645 skip_hbs_set:
1646 end set_hbs_bit;
1647
1648
1649
1650
1651 end_page:
1652 tdl.test_no_to_jump_to = tst.trm;
1653 tdl.doing_force = 1;
1654 tdl.endng = 1;
1655 tdl.force = 1;
1656 goto force_test;
1657
1658
1659 process_options:
1660 call options(tdp,tpp,check);
1661 if tdl.wait ^= 0 then goto wait_loop;
1662 if check ^=0 then goto tdl.optrtn;
1663 goto main_dispatch_queue_service;
1664
1665
1666 wait_loop:
1667 if tdl.wait = 0 then goto process_options;
1668 note
1669 tdl.clock_dispatch = wait_loop;
1670 tdl.clock_going = 1;
1671 call timer_manager_$alarm_wakeup(60000000,"10"b,tdl.clock_event);
1672
1673
1674 tdl.iocnt = tdl.iocnt +1;
1675 call edit_options(tdp,current_options);
1676 pnum = substr(page_no_char,tdl.pageno,1);
1677 call ioa_$rsnnl("^/^
1678
1679
1680
1681
1682
1683 say_invalid_instruction:
1684 chgmode = 0;
1685 lineno = tdl.line_number;
1686 fieldno = tdl.next_field_number - 1;
1687 tdl.rtnopt = process_options;
1688 tdl.optrtn = restart;
1689 pnum = substr(page_no_char,tdl.pageno,1);
1690 call edit_options(tdp,current_options);
1691 call ioa_$rsnnl("^/^
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746 note
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766 select_next_test_or_seg_or_start_or_end:
1767 call test_seq_init;
1768 if tdl.nxt ^= -1 then goto select_test;
1769 tdl.nxt,tdl.lst = 0;
1770 if tdl.initreq ^= 0 then goto say_end_cycle;
1771 tdl.initreq = -1;
1772
1773
1774
1775
1776
1777
1778
1779 pnum = substr(page_no_char,tdl.pageno,1);
1780 call ioa_$rsnnl("^/^
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827 check = search(page_no_char,the_char);
1828 check = check+1;
1829 tdl.call_page = substr(tst.name,1,5)||substr(page_no_char,check,1);
1830 call call_from_page;
1831
1832 new_segment_common:
1833 tdl.nxt = -1;
1834 tdl.initreq = 0;
1835 tdl.line_number = 0;
1836 goto select_next_test_or_seg_or_start_or_end;
1837
1838
1839 select_test:
1840 if tdl.doing_force = 1 then goto find_first_in_sequence;
1841 if tdl.opt = 0 then goto sequence_test;
1842 tdl.optrtn = sequence_test;
1843 goto process_options;
1844
1845
1846 sequence_test:
1847 call test_seq_init;
1848 if tdl.nxt = 0 then goto dont_loop_on_test_0;
1849 if loop ^=0 then goto loop_test;
1850 dont_loop_on_test_0:
1851 goto find_next_test;
1852
1853
1854 find_first_in_sequence:
1855
1856
1857 do dovar1 = 1 to ((tst.end-tst.fst)*4+1) by 4;
1858 if tst.testab(dovar1+1) = 1 then goto no_check_jump;
1859 if tdl.test_no_to_jump_to - tst.fst = tst.testab(dovar1+2) then goto jump_test_exists;
1860
1861
1862 no_check_jump:
1863 end;
1864 goto say_jumping_to_test_not_in_current_sequence;
1865
1866
1867
1868
1869 jump_test_exists:
1870 if (dovar1+3)/4 >= tdl.nxt then goto not_back_jump;
1871 passck = 1;
1872
1873
1874
1875 not_back_jump:
1876 tdl.nxt = (dovar1+3)/4;
1877 goto loop_test;
1878
1879
1880 restart:
1881 call test_seq_init;
1882 goto loop_test;
1883
1884
1885 skip_test:
1886 call test_seq_init;
1887 did_skip = 1;
1888 goto find_next_test;
1889
1890
1891 force_test:
1892 call test_seq_init;
1893 if test_no_to_jump_to >=(tst.fst+1)&test_no_to_jump_to <= tst.end
1894 then goto find_first_in_sequence;
1895 if tdl.endng ^=0 then goto find_first_in_sequence;
1896 the_char = "9";
1897
1898 try_next_segment:
1899 check = search(page_no_char,the_char);
1900 check = check+1;
1901 tdl.call_page = substr(tst.name,1,5)||substr(page_no_char,check,1);
1902 call call_from_page;
1903 if test_no_to_jump_to
1904 ^> tst.end then goto new_segment_common;
1905
1906 if tst.trm = tst.end then goto say_jumping_to_test_not_in_current_sequence;
1907 the_char = substr(tst.name,6,1);
1908 goto try_next_segment;
1909
1910
1911 find_next_test:
1912 if tdl.nxt+1 > (tst.end-tst.fst) then goto get_next_segment;
1913 tdl.nxt = tdl.nxt + 1;
1914
1915
1916 loop_test:
1917 non_exec_count = non_exec_count + 1;
1918 if non_exec_count = (tst.end-tst.fst) then goto say_no_executable_tests_in_sequence;
1919 if tst.testab((tdl.nxt-1)*4+2) = 0 then goto not_sequenced_jump;
1920 tdl.test_no_to_jump_to = tst.testab((tdl.nxt-1)*4+3);
1921 goto find_first_in_sequence;
1922
1923
1924 not_sequenced_jump:
1925 if tdl.doing_force ^=0 then goto select_test_at_line;
1926
1927
1928 if tst.testab((tst.testab((tdl.nxt-1)*4+3)-1)*4+1) ^= 0 then goto find_next_test;
1929
1930
1931 select_test_at_line:
1932 if tst.testab((tst.testab((tdl.nxt-1)*4+3)-1)*4+1) >1 then goto find_next_test;
1933
1934 tdl.line_number = tst.testab((tst.testab((tdl.nxt-1)*4+3)-1)*4+4);
1935 if tdl.test_no_to_jump_to = (tst.testab((tdl.nxt-1)*4+3)+tst.fst) then tdl.doing_force = 0;
1936 if tdl.endng ^=0 then goto start_test;
1937 if passck = 0 then goto check_for_inform;
1938 if tdl.pass =0 then goto check_for_inform;
1939 tdl.pascnt = tdl.pascnt + 1;
1940 if tdl.halt ^=0 then goto say_end_pass;
1941 if tdl.bypass = 0 then goto say_end_pass;
1942
1943
1944 check_for_inform:
1945 if tdl.inform = 0 then goto start_test;
1946 if did_skip ^=0 then goto start_test;
1947
1948 pnum = substr(page_no_char,tdl.pageno,1);
1949 last_test_no = tst.fst;
1950 if tdl.lst = 0 then goto test_zero_last;
1951 last_test_no = tst.testab((tdl.lst-1)*4+3)+tst.fst;
1952
1953
1954 test_zero_last:
1955 next_test_no = (tst.testab((tdl.nxt-1)*4+3)+tst.fst);
1956 halt_message = "";
1957 if tdl.halt = 0 then goto no_halt_at_inform_message;
1958 tdl.optrtn = start_test;
1959 tdl.rtnopt = process_options;
1960 tdl.optrd = 1;
1961 halt_message = "^/enter options:";
1962
1963 no_halt_at_inform_message:
1964 call ioa_$rsnnl("^/^
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009 lcset:
2010 if tio.tdcwr(tdl.tcwdl).char = "111"b|tio.tdcwr(tdl.tcwdl).typ = "10"b
2011 then goto lcset_error;
2012 tdl.tdtcal_reladd = fixed(tio.tdcwr(tdl.tcwdl).add)
2013 - fixed(rel(addr(tio.trarea(1))));
2014 tdl.tdtcal_wc = fixed(tio.tdcwr(tdl.tcwdl).wc);
2015 tdl.tfdcwp = addrel(addr(tio.tdcwr(1)),(tdl.tcwdl-1));
2016 if tdl.topcd.op_type = 3 then goto nxfld;
2017 tdl.tfdcwp = addrel(addr(tio.tdcww(1)),(tdl.tcwdl-1));
2018 goto nxfld;
2019
2020 lcset_error:
2021 inv_data = "cannot use tdcw or idcw as first dcw";
2022 goto say_invalid_instruction;
2023
2024
2025 lset:proc;
2026 data_setup_reladd = tdl.tdtcal_reladd;
2027 data_setup_wc = tdl.tdtcal_wc;
2028 end lset;
2029
2030
2031 dtypst:
2032
2033
2034
2035
2036
2037
2038 tdl.tdata = bit(fixed(octnum,36));
2039 call chgorl;
2040 call lset;
2041 if tdl.tdtyp <1|tdl.tdtyp >10 then goto bad_data_type;
2042 goto dtypst_data_setup(tdl.tdtyp);
2043
2044
2045 dtypst_data_setup(2):
2046 bad_data_type:
2047 call ioa_$rsnnl("^/tdl.tdtyp ^d illegal in dtypst"
2048 ,term_message,mesg_len,tdl.tdtyp);
2049 call set_polts_abort(term_message);
2050 goto main_dispatch_queue_service;
2051
2052
2053 dtypst_data_setup(1):
2054 call setup_random_data;
2055
2056
2057 dtypst_data_setup(7):
2058 goto nxfld;
2059
2060 dtypst_data_setup(3):
2061 call setup_octal_data;
2062 goto nxfld;
2063
2064 dtypst_data_setup(4):
2065 call setup_add_to_data;
2066 goto nxfld;
2067
2068 dtypst_data_setup(5):
2069 call setup_data_from_line;
2070 goto nxfld;
2071
2072 dtypst_data_setup(6):
2073 call setup_drot;
2074 goto nxfld;
2075
2076 dtypst_data_setup(8):
2077 call setup_packed_hex_data;
2078 goto nxfld;
2079
2080 dtypst_data_setup(9):
2081 call setup_unpacked_hex_data;
2082 goto nxfld;
2083
2084 dtypst_data_setup(10):
2085 call setup_adrot;
2086 goto nxfld;
2087
2088
2089 chgorl:proc;
2090 if tdl.tcwdl ^=0 then return;
2091 if chgmode <= 0 then goto nxfld;
2092 if tdl.topcd.op_type ^= 0 then goto nxfld;
2093 end chgorl;
2094
2095
2096 call_from_page:proc;
2097 callname = tdl.call_page;
2098 call tpinit(callname,tptr,error);
2099 if error = 0 then goto good_init;
2100 if error ^=1 then goto main_dispatch_queue_service;
2101
2102 call ioa_$rsnnl("^/error calling ^a^/no such test page",term_reason,output_length,
2103 callname);
2104 call set_polts_abort(term_reason);
2105 goto main_dispatch_queue_service;
2106
2107
2108
2109 good_init:
2110 free tst;
2111 tpp = tptr;
2112 tdl.page_ptr = tpp;
2113 end call_from_page;
2114