1 ******************************************************
2 * *
3 * *
4 * Copyright c 1972 by Massachusetts Institute of *
5 * Technology and Honeywell Information Systems, Inc. *
6 * *
7 * *
8 ******************************************************
9
10 lbl ,init
11 ttl init - fnp initialization module for multics
12 rem
13 ***********************************************************************
14 *
15 * note: cs means "central system"
16 *
17 ***********************************************************************
18 *
19 * init is the initialization module for mcs. it is entered from
20 * gicb just after bootload. init is always the last module
21 * loaded into the fnp and most of it is freed as buffer
22 * space after initialization is complete.
23 *
24 * this routine takes care of setting up each configured
25 * io channel and allocating tibs for each line.
26 *
27 * initially coded for gerts and stolen for mcs.
28 * modified by Coren for mcs.
29 * modified by grady and coren to delete pre-init code
30 * from other modules.
31 * modified by Grady to add stuff for printer init.
32 * modified by art beattie to support dn6670 extended memory.
33 * modified by Robert Coren to add allocation of metering area
34 * modified by Robert Coren to support buffers in extended memory and
35 * to eliminate code for 32k FNP.
36 * modified September 1983 by Robert Coren to check for zero-length
37 * trace buffer.
38 *
39 ***********************************************************************
40 rem
41 pcc on
42 pmc off
43 detail on
44 editp on
45 rem
46 symdef init
47 symdef istart
48 rem
49 symref ignore ignore interrupts routine
50 symref badint extraneous interrupt routine
51 symref exist summary of which iom channels exist
52 symref iomflt iom channel fault routine
53 symref hfv hardware fault vector entry base address
54 symref msdsp master dispatcher entry location
55 symref etrip elapsed timer rollover interrupt proc.
56 symref dicell dia configuration switch data location
57 symref dindcw dia_man interrupt dcw
58 symref wcon console routine entry point
59 symref contip console terminate interrupt proc address
60 symref conchn console channel number
61 symref getbuf buffer allocating subroutine
62 symref frebuf buffer freeing subroutine
63 symref frebfh free buffer in extended memory
64 symref getmem memory allocating subroutine
65 symref fremem memory freeing subroutine
66 symref fresml routine to clean up fres space
67 symref bfcksw switch that controls buffer checking
68 symref ctrl control tables
69 symref itest "test-state" entry to interpreter
70 symref hslajt hsla jump tables
71 symref diajt dia jump tables
72 symref dlist dia icws, pcws, etc.
73 symref diconf dia configuration area
74 symref consjt console jump tables
75 symref timrjt timer jump tables
76 symref utsave place in utilities where regs get saved
77 symref pterm printer terminate interrupt handler
78 symref pspec printer special handler
79 symref brktab addr of table in breakpoint_man
80 symref skdata address of scheduler data block
81 symref icmdat address of ic-moniroting data block
82 symref etrmon address of icmdat in sskdata
83 symref etrint address of timer interval in skdata
84 symref idlint idle metering interval
85 symref idloop start of idle loop
86 symref idlcnt counter maintained by idle loop
87 symref idlmax maximum idle count value
88 symref idlmin mininum " " "
89 symref dspqur secondary queuer
90 symref secdsp secondary dispatcher
91 symref setptw set page table word
92 symref trace trace module
93 symref endtrc in trace module last word in trace buffer
94 symref nxtrce in trace module next entry in trace buffer
95 symref mvplmm move paged lower memory maximum address
96 symref conman set to -1 by init if console_man is in image
97 symref getbfm interrupt time metering area for getbuf
98 symref diasel 'sel' instruction in dia_man
99 symref fpsel and two in utilities
100 symref obsel
101 rem
102 pmc save,on
103 systm
104 comreg
105 rem
106 hwcm
107 rem
108 tib
109 rem
110 meters
111 rem
112 sfcm hsla
113 rem
114 devtab
115 rem
116 buffer
117 eject
118 pbit bool 200
119 rem
120 rem character codes
121 rem
122 cr bool 15
123 lf bool 12
124 stx bool 2
125 esc bool 33
126 sync bool 26
127 us bool 37
128 rem
129 rem
130 ptro bool 2000 pre-tally runout status
131 rts bool 20 set request-to-send
132 dtr bool 40 data terminal ready
133 rcv bool 400 receive mode
134 snd bool 200 send mode
135 rem
136 rem pcw opcodes
137 rem
138 initop bool 10
139 reqcst bool 3
140 rstmsk bool 5
141 setmsk bool 4
142 stomrg bool 11
143 ttls configuration tree table definitions
144 ************************************************************************
145 * these symbolic names are used to access the various fields of the
146 * configuration tree table fig tree.
147 *
148 * three symbols are defined for each field:
149 *
150 * fa can be used as a mask to isolate the field.
151 * fb can be used as a mask when the field is right justified.
152 * fc the position ofthe lsb of the field.
153 *
154 * when changes are made to this table, be sure to check all useage
155 * of symbols beginning with "fa".
156 ************************************************************************
157 rem
158 fampx bool 400000 1 = multiplexed channel
159 fbmpx bool 1
160 fcmpx equ 0
161 rem
162 farel bool 200000 1 = device released
163 fbrel bool 1
164 fcrel equ 1
165 rem
166 faasyn bool 100000 1 = asynchronous device
167 fbasyn bool 1
168 fcasyn equ 2
169 rem
170 fadacn bool 070000 device number for hsla and lsla
171 fbdacn bool 7
172 fcdacn equ 5
173 rem
174 fatnd bool 004000 1 = t&d is in control
175 fbtnd bool 1
176 fctnd equ 6
177 rem
178 fachrl bool 003000 character length code
179 fbchrl bool 3
180 fcchrl equ 8
181 rem
182 fadevc bool 000760 device type code
183 fbdevc bool 37
184 fcdevc equ 13
185 rem
186 fasped bool 000017 device speed code
187 fbsped bool 17
188 fcsped equ 17
189 eject
190 rem *********************************************************
191 rem * device type codes
192 rem *********************************************************
193 rem
194 dnimp bool 00 not implemented
195 rem
196 dclock bool 01 fnp's clocks
197 rem
198 ddia bool 02 dia
199 rem
200 dhsla bool 03 hsla
201 rem
202 dlsla bool 04 lsla
203 rem
204 dcon bool 05 console
205 rem
206 dprint bool 06 printer
207 rem
208 rem unused codes 07 - 14
209 ttls symbol definition rem
210 rem
211 pmc on,save
212 hslatb
213 pmc restore
214 rem
215 rem
216 rem ********************************************
217 rem * modem types
218 rem ********************************************
219 rem
220 mt103a equ 1
221 mt201c equ 2
222 mt2025 equ 3
223 mt2026 equ 4
224 mt208a equ 5
225 mt208b equ 6
226 mt209a equ 7
227 rem 10-17 unused
228 rem
229 tt2741 equ 3 terminal type "2741"
230 ttbsc equ 7 line type for bisync
231 ttx25 equ 17 line type for x.25
232 tthdlc equ 18 line type for hdlc
233 ttcolt equ 19 line type for colts channel
234 rem
235 diardc bool 74 dia opcode -- read configuration
236 diadis bool 70 dia opcode -- disconnect
237 rem
238 rem
239 rem
240 init null
241 start init,9
242 pmc restore
243 rem
244 even
245 tibtab bss 816 2 words per tib unused space will be freed
246 ttls init macros
247 rem
248 rem *******************************************************
249 rem *
250 rem * dn6670 paged data address icw odd word
251 rem * allows IOM to directly address all 64k memory
252 rem *
253 rem *******************************************************
254 rem
255 amicwo macro
256 vfd 2/2,3/#1,1/#3,12/#2
257 endm amicwo
258 rem
259 rem
260 rem * multiply macro
261 rem
262 mpy macro
263 mpf #1
264 lrl 1
265 endm mpy
266 ttls miscellaneous subroutines
267 ************************************************************************
268 * setclk -- set interval timer
269 * rstclk -- reset interval timer
270 *
271 * entry -- setclk
272 *
273 * lda number milliseconds
274 * ldq return address on runout
275 * tsy setclk-*
276 *
277 * entry -- rstclk
278 *
279 * tsy rstclk-*
280 ************************************************************************
281 rem
282 setclk ind **
283 sti scindc-* save io select register
284 sel tmch select clock channel
285 cioc scoff-* turn clock off
286 sta scvalu-*,* store time value
287 stq sciv-*,* store user's iv
288 cioc scon-* turn clock on
289 ldi scindc-* restor io select reg <?><?><?><?><?><?><?><?>
290 tra setclk-*,* return
291 rem
292 rem
293 rem
294 rstclk ind **
295 sti scindc-* save io select register
296 sel tmch select clock channel
297 cioc scoff-* turn clock off
298 ldi scindc-* restore io select register <?><?><?><?><?>
299 tra rstclk-*,* return
300 rem
301 rem
302 rem
303 even
304 scon oct 0,0
305 scoff oct 0,010000
306 scvalu ind itmb interval timer mailbox address
307 sciv ind tmro interval timer runout iv address
308 scindc bss 1
309 ttls main initialization loop
310 rem
311 ******************************************************************************
312 *
313 * the code from istart-1 to the begining of channel initialization is only
314 * executed once. therefore, this code is located at the end of the module
315 * so it can be released as buffer space and used for tib and sfcm allocation.
316 * this helps in making available as much memory as
317 * possible for channel initialization.
318 *
319 ******************************************************************************
320 rem
321 rem
322 rem *********************************************************
323 rem * scan fig tree and initialize devices
324 rem *********************************************************
325 rem
326 figtre ind **+0,1 points to current "fig" -- 1st word
327 ind **+1,1 points to current "fig" -- 2nd word
328 rem
329 itl010 null
330 lda iomch-*
331 als 1
332 cax1 x1 = 2 * iom channel number
333 lda figtre-*,* pluck a fig from the tree of knowledge
334 caq
335 ldx2 figtre+1-*,* get wd 2 of entry
336 arl 18-fcdevc-1 r-just device code bits
337 rem
338 rem * at this point,
339 rem * q = word 0 of config table
340 rem * x1 = 2 * iom channel #
341 rem * x2 = word 1 of config table
342 rem
343 iana fbdevc ? non-implemented channel ?
344 tze nodev-* yes
345 icmpa ddia ? device = dia ?
346 tze a.a001-*,* dia yes
347 icmpa dhsla ? device = hsla ?
348 tze a.a002-*,* hsla yes
349 icmpa dprint ? device = printer ?
350 tze a.a004-*,* print yes
351 icmpa dclock ? device = clocks ?
352 tze a.a005-*,* clocks yes, also -- last iom channel
353 rem
354 itl020 null
355 aos iomch-* bump to next iom channel
356 tra itl010-*
357 rem
358 rem
359 rem device initialization routines:
360 a.a001 ind dia direct interface adapter
361 a.a002 ind hsla high speed line adapter
362 *a.a003 unused
363 a.a004 ind print line printer
364 a.a005 ind clocks clocks -- final start up procedures
365 a.a006 zero savein
366 rem
367 l.a001 qls 0
368 savein bss 3*16
369 ttls nodev -- initialize for non-implemented channel
370 ************************************************************************
371 * non-implemented channel:
372 *
373 * --set appropriate iv's to point to an "extraneous interrupt"
374 * reporting routine.
375 *
376 * --send a mask pcw bit 23 =1 to insure channel is off.
377 ************************************************************************
378 rem
379 nodev null
380 rem
381 lda iomch-* compute base address of iv's for
382 als 1 this channel
383 ada iomch-*
384 ada a.a006-* savein
385 cax1
386 lda a.b001-* badint
387 sta 0,1
388 sta 1,1
389 sta 2,1
390 lda iomch-* store channel # in "sel"
391 ora l.b001-* sel 0 instruction
392 sta ndv010-*
393 rem
394 ndv010 sel ** select the channel
395 cioc nmpcw-* send mask pcw
396 rem
397 tra itl020-*
398 rem
399 rem
400 rem
401 a.b001 ind badint
402 rem
403 l.b001 sel 0
404 rem
405 iomch zero 0 current iom channel number
406 even
407 nmpcw oct 0,010000 pcw0 -- mask channel
408 ttls print - initialize for line printer
409 **********************************************************************
410 * setup to run the line printer. init the interrupt vectors
411 * into ptrac.
412 **********************************************************************
413 rem
414 print null
415 rem
416 lda iomch-* get the channel number
417 als 1 times 2
418 ada iomch-* now is times 3
419 ada a.a006-* savein plus base of save area
420 cax1 copy into x1
421 rem
422 lda a.c001-* pspec get special handler addr
423 sta 1,1 put into save area
424 lda a.c002-* pterm and terminate handler
425 sta 2,1 save it too, to be restored later
426 rem
427 tra itl020-* return for next channel
428 rem
429 rem
430 a.c001 ind pspec
431 a.c002 ind pterm
432 ttls dia -- initialize for inter-computer adapter
433 ************************************************************************
434 * this routine initializes the dia by reading the setting of the
435 * configuration data switches.
436 ************************************************************************
437 rem
438 dia null
439 rem
440 aos icflag-*
441 rem
442 lda iomch-*
443 cmpa diachn-* is it the one on which we got the interrupt?
444 tnz itl020-* no, ignore it altogether
445 orsa dia030-*
446 orsa dia070-*
447 orsa dia020-*
448 orsa a.d007-*,* bst010
449 orsa a.d025-*,* diasel in dia_man
450 orsa a.d026-*,* fpsel in utilities
451 orsa a.d027-*,* obsel in utilities
452 als 1 set level 1 iv to extraneous int routine
453 ada iomch-*
454 ada a.a006-* savein
455 cax1
456 lda a.b001-* badint
457 sta 1,1
458 rem
459 lda l.d001-* =o400000
460 dia020 arl **
461 sta cdiaic-* save operand for "sic"
462 rem
463 ldq a.d002-*,* exist
464 dia030 qls ** ? does this channel exist ?
465 tmi dia040-* yes
466 tra 1,*
467 ind stop04 "dia does not exist" eeeeeeeeeeeeeeeeeeee
468 rem
469 dia040 ldx2 a.d010-* diajt
470 stx2 2,1 put address of dia terminate jump table
471 rem in saved iv
472 lda diachn-* and put dia channel no. in jump table entries
473 als 14 line it up
474 orsa 2,2
475 ldx1 a.d011-* dis0 -- first dia "special" iv
476 ilq -16 we will store 16 jump table addresses
477 dia050 iacx2 3 increment jump table address
478 stx2 0,1 put it in interrupt vector
479 orsa 2,2 and store channel number
480 iaq 1 bump counter
481 tze dia060-* all done
482 iacx1 16 no, bump interrupt vector address
483 tra dia050-* go round again
484 rem
485 dia060 ldx2 a.d012-* dlist
486 lda 1,2 get 2nd word of status icw template
487 ora l.d003-* =o010000 'or' in exhaust bit
488 caq
489 lda 0,2 get rest of status icw template
490 staq a.d013-*,* dist store it in status icw mbx
491 cx2a
492 iaa 2 point to pcw template
493 cax3 in x3
494 ila 2 get count
495 cax1
496 tsy a.d014-*,* parity
497 rem pcw has correct parity now
498 ldaq 2,2 pick it up
499 staq a.d001-*,* dimb put it in pcw mailbox
500 rem
501 iacx2 6 point x2 at dcw area
502 ila 0 we will set up dcw list to read configuration
503 ilq diardc config opcode 74
504 staq 0,2
505 lda a.d015-* diconf,w.2
506 ilq 4
507 staq 2,2
508 rem now disconnect dcw
509 ila diadis disconnect opcode 70
510 sta 5,2
511 lda l.d002-* 0w.2
512 sta 6,2
513 cx2a
514 cax3 copy into x3 for parity subroutine
515 ila 8 get count
516 cax1
517 tsy a.d014-*,* parity
518 rem
519 dia070 null
520 sel **
521 lda diatmv-*,* pick up terminate vector location of
522 sta ictmtp-* dia and temp store it
523 lda a.d008-* dia090 pick up location to use for this
524 sta diatmv-*,* terminate and put in iv loc
525 cioc a.d001-*,* dimb pcw -- read dia configuration switches
526 rem
527 ila 5 set timeout 5 ms for terminate interrupt
528 ldq dia080-1-* pick up addr of timeout handler
529 tsy a.d005-*,* setclk and go start up clock
530 dis wait for dia interrupt
531 tra -1 dont let just any interrupt do it
532 rem
533 ind dia080
534 dia080 ind **
535 tra 1,*
536 ind stop05 "dia did not respond in time" eeeeeeeeeee
537 rem
538 dia090 ind ** gets "tsy"d to on dia interrupt
539 tsy a.d006-*,* rstclk dia terminate interrupt occurred
540 rem
541 lda a.d016-* dia100 get new temporary iv
542 sta diatmv-*,*
543 ldaq initst-* get "init entered" status
544 tsy a.d024-*,* btsts send it to dia
545 tra dia100+1-* if we come here, we are in sim
546 rem
547 rem btsts waits for interrupt
548 rem
549 dia100 ind ** tsy'd to after interrupt
550 lda ictmtp-* pick up saved loc of dia terminate
551 sta diatmv-*,* handler, and put it back
552 rem
553 rem put terminate interrupt cell into dia_man's dcw
554 lda a.d003-*,* dicell get it from configuration switches
555 arl 3 isolate terminate interrupt cell
556 als 6
557 orsa a.d009-*,* dindcw
558 rem dia is all set up now
559 tra itl020-*
560 eject
561 rem
562 a.d001 ind dimb dia mailbox address
563 a.d002 ind exist
564 a.d003 ind dicell
565 a.d005 ind setclk
566 a.d006 ind rstclk
567 a.d007 ind bts010
568 a.d008 ind dia090
569 a.d009 ind dindcw
570 a.d010 ind diajt
571 a.d011 ind dis0
572 a.d012 ind dlist
573 a.d013 ind dist
574 a.d014 ind parity
575 a.d015 zero diconf,w.2
576 a.d016 ind dia100
577 a.d017 ind hslano
578 a.d018 ind hlahcr
579 a.d019 ind getchn
580 a.d020 ind hmsg01+2
581 a.d021 ind iwcon
582 a.d022 ind hslajt
583 a.d023 zero .criom
584 a.d024 ind btsts bootload status reporting routine
585 a.d025 ind diasel 'sel' instruction in dia_man
586 a.d026 ind fpsel 'sel' instruction in fault processor
587 a.d027 ind obsel 'sel' instruction in crash routine
588 rem
589 l.d001 oct 400000
590 l.d002 zero 0,w.2
591 l.d003 oct 010000 exhaust bit
592 even
593 initst oct 450000,000000 "init entered" status
594 rem
595 cdiaic bss 1
596 icflag oct 0
597 ictmtp oct 0
598 diachn bss 1 dia iom channel
599 diatmv ind ** patched to address of dia terminate vector
600 ttls hsla -- initialize for high speed line adapter
601 rem
602 ************************************************************************
603 *
604 * this routine will initialize all that is necessary to operate
605 * from one to three high speed line adapters. subchannels which are
606 * found to not exist or configured improperly will be marked by
607 * setting the "exhaust" bit in the active status icw. no tib or software
608 * comm region will be created for such subchannels.
609 *
610 ************************************************************************
611 rem
612 rem
613 rem * this procedure is entered with:
614 rem * q = word 0 of config table
615 rem * x1 = 2 * iomchannel #
616 rem * x2 = word 1 of config table
617 rem
618 hsla null
619 cqa lets figure out the hsla #
620 arl 18-fcdacn-1 from word 0 of config table
621 iana fbdacn -- now we have got it
622 iaa -1 internal count is from 0
623 sta a.d017-*,* hslano save it for later
624 iaa 1
625 als 9 multiply by 1000 octal and we
626 sta a.d018-*,* hlahcr have the hardware region address
627 rem
628 cax3 x3 -> this hsla hardware comm region
629 rem
630 lda iomch-* now, lets see if this iom channel
631 ora l.a001-* qls 0 exists from the "exist" variable
632 sta +2 put this "qls iomch#" where we will execute it
633 ldq a.d002-*,* exist pick up the knowledgeable variable
634 qls ** and shift left until our bit is in the
635 rem sign position this loc patched
636 tmi hsl010-* this channel does exist
637 rem
638 tsy a.d019-*,* getchn get the current iom chan # in ascii
639 stq a.d020-*,* hmsg01+2 and save its ascii value
640 tsy a.d021-*,* iwcon use "disaster" mode console routine
641 ind hicw01
642 nop dont bomb if no console exists
643 tra itl020-* give up on this hsla
644 rem
645 hsl010 null hsla does exist, and was initialized
646 ila 97 get size of each jump table per hsla
647 mpy hslano-* times hsla no to get addr offset
648 rem
649 adq a.d022-* hslajt add in base addr
650 stq hjtloc-* save
651 aos hjtloc-* bump by one to skip ind word
652 rem
653 stz hsbchn-* set to 0th subchannel
654 cx1a get iom channel no.
655 rem times 2
656 ada a.d023-*,* .criom
657 cax2 pointer to iom table entry
658 ldx2 1,2 pointer to hsla table
659 rem
660 rem *********************************************************
661 rem *
662 rem * perform the following initialization procedures for
663 rem * each subchannel that was configured in the cdt.
664 rem * if a subchannel does not exist, or does not conform
665 rem * to the configuration desired, set the "exhaust" bit in
666 rem * its active status icw; otherwise, allocate a tib
667 rem * terminal information block and a software comm.
668 rem * region for the subchannel.
669 rem *
670 rem *********************************************************
671 rem
672 hsl020 null
673 lda iomch-* get the iom channel number
674 ora l.b001-* sel 0 and build a "sel" instruction
675 sta 1 and put it where we'll use it
676 sel ** patched select this hsla
677 rem
678 ldaq h.cnfg,3 get config pcw, if any stored
679 rem here by load_fnp_ routine
680 tze hsl400-* this channel isnt configured
681 rem
682 staq hcnfig-* save the configuration pcw
683 rem
684 cx3a get addr of hwcm into the a
685 arl 9 divide by 10008
686 als 2 multiply by 48
687 sta hivloc-* save as iv location so far
688 lda hsbchn-* get subchannel number
689 icmpa 16 is it > 208?
690 tmi hsl030-* no, continue
691 rem
692 aos hivloc-* yes, bump ivloc by one
693 iaa -16 and decrement sbchn by 16
694 hsl030 als 4 multiply subchn by 208
695 asa hivloc-* add into ivloc
696 rem
697 lda hjtloc-* get the jump table addr
698 sta hivloc-*,* deposit in iv
699 rem
700 ldaq hsticw-* set my active status icw
701 staq h.aicw,3 and store it in hwcm
702 rem
703 rem build an "unmask" pcw
704 lda hsbchn-* load subchannel number
705 als 6 move into subchannel field
706 ora hunmsk-* or in pcw 0, command 5
707 ldq hunmsk+1-* and pick up no broadside commands
708 staq hpcw-* and save this pcw for execution
709 rem
710 cioc hpcw-* unmask the subchannel
711 rem
712 cioc hcnfig-* configure this subchannel
713 rem
714 lda hsbchn-* now lets build a "request config" pcw
715 als 6 move subchannel number in
716 ora hreqcn-* =230000 pcw 1,command 3
717 ldq hreqcn+1-* get second word request to send
718 staq hpcw-* and save it for a bit later
719 rem
720 stz h.cnfg,3 clear config status words to be able
721 stz h.cnfg+1,3 to detect no response
722 rem
723 cioc hpcw-* request configuration status
724 rem
725 ila 10 wait 10 ms for status store
726 ldq hsl040-1-* get location to tsy thru then
727 tsy a.f001-*,* setclk go start up the clock
728 dis
729 tra -1 ignore all interrupts til then
730 rem
731 ind hsl040
732 hsl040 ind ** control gets here when done waiting
733 rem for config status store
734 rem *********************************************************
735 rem * now test received configuration status against
736 rem * desired configuration and other criteria.
737 rem *********************************************************
738 rem
739 ldaq hcnfig-* test upper half for matching bits
740 ana hmask1-* =o600076 see hmask1 for expl
741 sta htemp-* this is what it should be
742 rem
743 lda h.cnfg,3 now, lets see what it is
744 ana hmask1-* =o600076 see hmask1 for expl
745 cmpa htemp-* see if what is is what should be
746 tnz hsl390-* nope, go mask off channel
747 rem
748 cana l.f002-* =o200000 is it synchronous?
749 tnz hsl050-* if so, don't bother with second word
750 rem
751 lda h.cnfg+1,3 pick up lower half of status to test char length
752 ana l.f003-* =o170000 mask out all but character lengths
753 cmpa l.f004-* =o040000 see if 8 bit byte size
754 tze hsl050-* yes, this is ok
755 cmpa l.f005-* =o020000 see if 7 bit byte size
756 tze hsl050-* yes, this is ok
757 cmpa l.f006-* =o010000 see if 6 bit byte size
758 rem yes, this is ok, fall through
759 tnz hsl390-* not ok, mask out this channel
760 rem
761 rem
762 hsl050 null
763 lda ht.flg,2 get the baud rate into
764 iana htfspd hbaud for maktib
765 sta hbaud-*
766 rem
767 lda ht.flg,2 get flags again
768 ana l.f008-* hftasy is it sync or async?
769 arl 7 just put bit into hbaud
770 orsa hbaud-* in the right place
771 rem
772 stx2 hsavx2-* save ptr to hsla table entry
773 rem set up software comm. region and tib
774 stx3 hsavx3-* save hardware comm. region address
775 tsy a.f003-*,* hgsfcm allocate an sfcm
776 rem
777 ldx3 hsavx3-* get hwcm address and store
778 sta h.sfcm,3 software comm. region address
779 rem
780 rem set up active status icw in hwcm
781 iaa sf.sta point to hardware status in sfcm
782 ldq hsaicw-* get odd word of dn6670 status icw
783 staq h.aicw,3 note that the channel can store 6 though
784 rem tally is set to 5. hardware stores status
785 rem in sixth word after tally runout.
786 lda l.f010-* =o10000 exhaust bit in icw
787 sta h.sic0+1,3 init both of the xmit
788 sta h.sic1+1,3 to exhaust condition
789 rem
790 rem now get line number
791 ldq hslano-* hsla number
792 qls 6
793 adq hsbchn-* subchannel no.
794 adq l.f001-* =o1000 hsla indicator
795 rem now make the tib
796 lda hbaud-* restore baud code
797 tsy a.f008-*,* maktib allocate a tib for it
798 rem
799 sta ht.tib,2 put real tib address in hsla table entry
800 rem
801 lda h.sfcm,3 get real sfcm address from hwcm
802 tsy a.f013-*,* setptw virtualize it
803 sta t.sfcm,1 put virtual sfcm address in tib
804 cax2 get it into right register
805 rem
806 rem fill in stuff in sfcm
807 rem
808 stx3 sf.hcm,2 put hwcm addr into sfcm
809 cx2a get sfcm addr in a
810 iaa sf.waq put starting address of wraparound queue
811 sta sf.nxa,2 in sfcm pointers
812 sta sf.nxp,2
813 lda a.f016-*,* hsfssl initialize count of free slots in queue
814 sta sf.tly,2
815 sta sf.ssl,2 save as status queue length too
816 lda hsavx2-* address of hsla table
817 sta sf.hsl,2 save addr in sfcm
818 rem
819 ldx2 hsavx2-* reload ptr to hsla table
820 lda ht.flg,2 get the flag bits
821 arl 4 shift line type into position
822 iana 31 mask down
823 tze hsl060-* none specified, use default
824 rem
825 sta t.type,1 put into tib
826 rem
827 hsl060 lda ht.flg,2 reload flag bits
828 sta htflgt-* save in "stack" temporary
829 ldx2 t.sfcm,1 reload sfcm ptr
830 cana l.f008-* htfasy asynchronous?
831 tnz hsl070-* yes
832 lda l.f017-* sffsyn no, mark the sfcm
833 orsa sf.flg,2
834 lda htflgt-* get the hsla table flags back
835 rem
836 hsl070 null
837 arl 9 look at modem type this time
838 iana 15 mask down
839 tze hsl180-* none specified
840 rem
841 iaa -1 relative to zero
842 ada a.f011-* hsl080 get jump list base
843 sta hsltra-* store so we can indirect
844 rem
845 tra hsltra-*,* dispatch on modem type
846 rem
847 hsl080 tra hsl130-* mt103a
848 tra hsl090-* mt201c
849 tra hsl140-* mt202c5
850 tra hsl150-* mt202c6
851 tra hsl160-* mt208a
852 tra hsl120-* mt208b
853 tra hsl170-* mt209a
854 rem
855 hsl090 lda htflgt-* get ht flags
856 cana l.f011-* htfpl private line dataset?
857 tnz hsl180-* yes, all done
858 rem
859 hsl100 lda l.f012-* tfdlup set tib flag for dial operation
860 orsa t.flg,1 in first tib flag word
861 tra hsl180-* done
862 rem
863 hsl120 tra hsl100-* 208b are always dial
864 rem
865 hsl130 null nothing special for these datasets
866 hsl140 null
867 hsl150 null
868 hsl160 null
869 hsl170 null
870 hsl180 null
871 eject
872 rem process line type specification
873 rem
874 lda t.type,1 now process type setting
875 iaa -1 can never be zero here
876 ada a.f012-* hsl190 get table base
877 sta hsltra-* save to indirect through
878 rem
879 tra hsltra-*,* dispatch on line type
880 rem
881 hsl190 null
882 tra hsl200-* ascii
883 tra hsl210-* 1050
884 tra hsl220-* 2741
885 tra hsl240-* ards
886 tra hsl250-* sync
887 tra hsl260-* g115
888 tra hsl230-* bsc
889 tra hsl270-* 202etx
890 tra hsl280-* vip
891 tra hsl290-* async1
892 tra hsl300-* async2
893 tra hsl310-* async3
894 tra hsl320-* sync1
895 tra hsl330-* sync2
896 tra hsl340-* sync3
897 tra hsl350-* polled vip
898 tra hsl234-* X.25 LAP
899 tra hsl234-* HDLC
900 tra hsl359-* COLTS
901 rem
902 hsl200 lda htflgt-* get hsla table flag bits
903 cana l.f014-* hftop1 option 1 set?
904 tze hsl360-* no
905 lda l.f016-* tfauto opt1 means autobaud
906 orsa t.flg,1
907 tra hsl360-*
908 rem
909 hsl210 null 1050 or
910 hsl220 ila sffebd 2741
911 orsa sf.flg,2 set ebcdic flag in sfcm
912 tra hsl360-* done
913 rem
914 hsl230 lda l.f013-* sffbsc bsc type
915 orsa sf.flg,2 set sffbsc in sfcm
916 tra hsl360-*
917 rem
918 hsl234 lda l.f015-* =sffhdl HDLC type
919 orsa sf.flg,2 set in SFCM
920 tra hsl360-*
921 rem
922 hsl240 null nothing to do for these types
923 hsl250 null
924 hsl260 null
925 hsl270 null
926 hsl280 null
927 hsl290 null
928 hsl300 null
929 hsl310 null
930 hsl320 null
931 hsl330 null
932 hsl340 null
933 hsl350 null
934 hsl359 null
935 hsl360 null
936 eject
937 rem
938 stx1 sf.tib,2 put tib addr in sfcm
939 rem
940 ldaq hcnfig-* get configuration pcw for channel
941 staq sf.cfg,2 store it in sfcm for later modifications
942 rem
943 ldx2 hsavx2-* reload ptr to hsla table
944 ldx3 hsavx3-* and ptr to hwcm
945 rem
946 rem
947 hsl380 null increment to next subchannel
948 iacx2 2 next hsla table entry
949 iacx3 16 hwcm is 16 words long
950 aos hsbchn-* bump subchannel number
951 ila 3 bump jump table ptr
952 asa hjtloc-* by three
953 rem
954 ila 32 valid numbers are 0 - 31
955 cmpa hsbchn-* see if still more subchannels
956 tnz hsl020-* yes, go process them
957 rem no, now store the mask register
958 rem
959 cioc hsmska-* store the mask register
960 cioc hsmskb-* in case this is a dn6670, do it for each mlc
961 cioc hsmskc-*
962 cioc hsmskd-*
963 rem
964 tra 1,* return to main routine
965 ind itl020
966 rem
967 rem
968 hjtloc bss 1 hold current jump table addr
969 hsbchn bss 1 this loc always has cur subchannel number
970 hslano bss 1 current hsla number
971 eject
972 rem
973 hsl390 null come here for bad configuration
974 tsy a.f002-*,* hgetch get iom channel number in ascii
975 stq hmsg02+2-* and store in error message
976 lda hsbchn-* pick up subchannel number
977 ada a.f005-* hsasbc add offset of subchannel table
978 sta htemp-* store it for a moment
979 lda htemp-*,* and pick up ascii equiv of subch nums
980 sta hmsg02+6-* and store into error message
981 tsy a.f004-*,* iwcon use disaster mode console routine
982 ind hicw02
983 nop ignore inability to write on console
984 rem
985 ila -1 set sfcm addr in hwcm to -1
986 sta h.sfcm,3
987 lda hsbchn-* load subchannel number
988 als 6 move into subchannel field
989 ora hmskch-* or in pcw 0, command 4
990 ldq hmskch+1-* and pick up no broadside commands
991 staq hpcw-* and store for execution
992 rem
993 cioc hpcw-* mask this subchannel
994 rem
995 rem end up here for badly-configured or
996 rem non-configured line
997 hsl400 null we will set up active status icw with
998 rem exhaust bit on
999 cx3a get hwcm address
1000 iaa h.baw we will point status icw at base address word
1001 rem pointer to avoid getting status stored randomly
1002 ldq hbdicw+1-* get rest of icw with exhaust bit
1003 staq h.aicw,3
1004 tra hsl380-* on to next subchannel
1005 rem
1006 rem
1007 even
1008 rem
1009 hbdicw icw **,w.2,1,1 status icw for inactive subchannel
1010 rem
1011 hsticw icw hstat,w.2,1 icw to store status for configuration
1012 hicw01 icw hmsg01-1,b.0,32 icw to type on fnp console
1013 hicw02 icw hmsg02-1,b.0,44 icw to type on fnp console
1014 rem status
1015 rem
1016 rem pcw to unmask a subchannel
1017 hunmsk vfd 2/0,4/rstmsk,2/0,4/**,6/0,18/0
1018 rem
1019 rem pcw to mask a subchannel
1020 hmskch vfd 2/0,4/setmsk,2/0,4/**,6/0,18/0
1021 rem pcw to request configuration status
1022 hreqcn vfd 2/1,4/reqcst,2/0,4/**,6/0,18/rts
1023 rem pcw to store the mask register
1024 hsmska vfd 2/0,4/stomrg,12/0,18/0
1025 hsmskb vfd 2/0,4/stomrg,6/8,6/0,18/0
1026 hsmskc vfd 2/0,4/stomrg,6/16,6/0,18/0
1027 hsmskd vfd 2/0,4/stomrg,6/24,6/0,18/0
1028 hpcw bss 2 temporary for pcws to execute
1029 hcnfig bss 2 temporary for configuration pcw
1030 hastat bss 2 temporary storage for status icw
1031 rem
1032 hstat bss 4 destination of status words for configuration
1033 rem
1034 hsaicw amicwo w.2,sfhsiz,0 dn6670 icw prototype odd word for hardware
1035 rem status
1036 htibad bss 1 tib address
1037 hbaud bss 1 baud rate codetemporary
1038 hivloc bss 1 holds location of iv for this subchannel
1039 htemp bss 1 an alround temporary
1040 hsavx2 bss 1 place to save hsla table addr
1041 hsavx3 bss 1 place to save hwcm address
1042 hsltra bss 1 jump indirect through this word
1043 htflgt bss 1 temp for hsla table flags
1044 hlahcr vfd 3/0,15/** hsla's hcr base address
1045 hmask1 oct 600076 mask to leave only mbo's async/sync
1046 rem parity stuff icw alternation and ccc enabled
1047 hmask2 oct 004377 mask to leave only 2 stop bits and speed
1048 rem
1049 a.f001 ind setclk routine to delay for n ms
1050 a.f002 ind getchn routine to convert iom channel to ascii
1051 a.f003 ind hgsfcm
1052 a.f004 ind iwcon routine to write on console if there
1053 a.f005 ind hsasbc table of ascii equivs of subch nums
1054 a.f006 ind .crmem last legal address configured
1055 a.f007 ind getmem memory allocating subroutine
1056 a.f008 ind maktib subroutine for making a tib
1057 a.f009 ind .crtrb base address of trace buffer
1058 a.f010 ind tibadr real tib address
1059 a.f011 ind hsl080
1060 a.f012 ind hsl190
1061 a.f013 ind setptw set up page table entry
1062 a.f014 ind .crmet flag indicating metering
1063 a.f015 ind metadr real metering area address
1064 a.f016 ind hsfssl number of entries in software status queue
1065 rem
1066 rem
1067 l.f001 oct 1000 hsla indicator
1068 l.f002 oct 200000 this bit is on if synchronous
1069 l.f003 oct 170000 mask to leave only char length field
1070 l.f004 oct 040000 char length field of 6 bits
1071 l.f005 oct 020000 char length field of 7 bits
1072 l.f006 oct 010000 char length field of 8 bits
1073 l.f007 oct 000400 bit for marking asynch baud code
1074 l.f008 vfd 18/htfasy "async" bit in hsla table entry
1075 l.f009 zero 0w.2 36-bit addressing
1076 l.f010 oct 010000 exhaust bit in icw
1077 l.f011 vfd 18/htfpl private line flag
1078 l.f012 vfd 18/tfdlup dialup flag in tib
1079 l.f013 vfd 18/sffbsc bisync bit in sfcm
1080 l.f014 vfd 18/htfop1 hsla table option flag 1
1081 l.f015 vfd 18/sffhdl HDLC channel
1082 l.f016 vfd 18/tfauto autobaud flag in tib
1083 l.f017 vfd 18/sffsyn synchronous flag in sfcm
1084 l.f018 oct 024000 inhibit interrupts and overflow
1085 rem
1086 detail off dont print all the words for messages
1087 rem
1088 vfd 9/cr9/lf
1089 hmsg01 aci 14*ch-xx hsla does not exist
1090 vfd 9/cr9/lf
1091 hmsg02 aci 20*ch-xx sch-xx bad configuration status
1092 vfd 9/cr9/lf
1093 rem
1094 hsasbc null table of ascii subchannel nums
1095 aci 100
1096 aci 101
1097 aci 102
1098 aci 103
1099 aci 104
1100 aci 105
1101 aci 106
1102 aci 107
1103 aci 108
1104 aci 109
1105 aci 110
1106 aci 111
1107 aci 112
1108 aci 113
1109 aci 114
1110 aci 115
1111 aci 116
1112 aci 117
1113 aci 118
1114 aci 119
1115 aci 120
1116 aci 121
1117 aci 122
1118 aci 123
1119 aci 124
1120 aci 125
1121 aci 126
1122 aci 127
1123 aci 128
1124 aci 129
1125 aci 130
1126 aci 131
1127 aci 132
1128 aci 133
1129 aci 134
1130 aci 135
1131 aci 136
1132 aci 137
1133 aci 138
1134 aci 139
1135 aci 140
1136 aci 141
1137 aci 142
1138 aci 143
1139 aci 144
1140 aci 145
1141 aci 146
1142 aci 147
1143 aci 148
1144 aci 149
1145 aci 150
1146 aci 151
1147 aci 152
1148 rem
1149 detail on
1150 ttls hsla subroutine to get a sfcm or sfcm/tib pair
1151 rem
1152 hgsfcm subr hgsx1x2i
1153 rem
1154 rem figure out sfcm size
1155 lda ht.flg2
1156 arl 4 shift line type down
1157 iana 31 isolate it
1158 icmpa ttx25 x.25?
1159 tze hgs001-* yes
1160 icmpa tthdlc hdlc?
1161 tze hgs001-* yes
1162 icmpa ttbsc bisync?
1163 tze hgs001-* yes
1164 ilq sfssq none of above use short status queue
1165 tra hgs002-*
1166 hgs001 ilq sflsq use long size
1167 hgs002 stq hsfssl-* save queue length
1168 qls 2 multiply by 4 to get in words
1169 iaq sf.hln add basic sfcm length
1170 stq hsflen-* this is total size to allocate
1171 rem
1172 rem
1173 rem
1174 rem *****************************************************************
1175 rem * the following code allocates space for a sfcm and tib
1176 rem * starting at 32768. the sfcm and tib have to be allocated in
1177 rem * the same page for a given channel.
1178 rem *
1179 rem * since the tib has to be allocated now its real address is
1180 rem * stored in 'tibadr'. the 'maktib' subroutine is coded to
1181 rem * account for this.
1182 rem *****************************************************************
1183 rem
1184 stz hmetln-* initially
1185 szn a.f014-** .crmet are we metering at all?
1186 tze hgs008-* no skip this calculation
1187 lda ht.flg2 see if it's synchronous channel
1188 cana l.f008-* =htfasy
1189 tnz hgs003-* no
1190 ilq m.synl yes use synchronous length
1191 tra 2
1192 hgs003 ilq m.asyl else asynchronous
1193 stq hmetln-* save this for later
1194 hgs008 null
1195 lda hcurpg-* get page base address
1196 ada hsflen-* recalculate the end of the pair
1197 sta a.f010-** tibadr
1198 ada htibln-*
1199 sta a.f015-** metadr
1200 ada hmetln-*
1201 caq get it into the right register
1202 rem
1203 hgs010 null
1204 szn a.f009-** .crtrb is trace configured?
1205 tnz hgs020-* yes
1206 cmpq a.f006-** .crmem no. will sfcm/tib pair fit in
1207 tra hgs030-* rest of memory?
1208 rem
1209 hgs020 null
1210 cmpq a.f009-** .crtrb will sfcm/tib pair fit below
1211 rem trace buffer?
1212 hgs030 null
1213 tnc hgs040-* yes. we are cool
1214 tze hgs040-* whew. this better be the last one
1215 die 1 no. out of memory
1216 rem
1217 hgs040 null
1218 stq hnxstp-*
1219 lda hcurpg-* get sfcm address for return
1220 caq
1221 ldi l.f018-* =o024000 inhibit overflow
1222 adq l.i006-* =256
1223 stq hcurpg-* save address of next page for next pair
1224 rem
1225 hgsret null
1226 return hgsfcm
1227 rem
1228 rem
1229 hcurpg dec 32768 base of current page
1230 hnxstp dec 32768 pointer to next sfcm/tib pair
1231 hsflen oct 0 next even number of words in sfcm
1232 hsfssl oct 0 size of software status queue
1233 htibln oct 0 next even number of words in tib
1234 hmetln oct 0
1235 ttls maktib -- subroutine to allocate a tib
1236 rem
1237 rem this subroutine allocates space for a tib terminal
1238 rem information block and fills in stuff common to hsla
1239 rem and lsla
1240 rem
1241 rem input:
1242 rem a reg contains baud rate code
1243 rem with bit 9 marking asynch line
1244 rem q reg contains line number
1245 rem
1246 rem output:
1247 rem x1: contains virtual tib address
1248 rem a: contains real tib address
1249 rem
1250 maktib subr makx2x3
1251 rem
1252 staq mtemp-* save baud rate code and line number
1253 lda tibadr-* get real tib address
1254 *
1255 * save tib address in table for later use
1256 rem
1257 ldx2 a.i003-** .crtte get address of next available slot
1258 sta 02
1259 iacx2 2 bump pointer
1260 stx2 a.i003-** .crtte
1261 rem
1262 ldx3 a.i001-* ctrl get control_tables address
1263 ldx3 33 x3 points to device type table
1264 rem
1265 mak020 null search table for type corresponding to baud rate
1266 lda 03 get table entry
1267 icmpa -1 hit end of table?
1268 tnz 2
1269 die 6 if so very bad news
1270 lrl 9 get baud rate code in a device type in q
1271 cmpa mtemp-* matches argument?
1272 tze mak030-*
1273 iacx3 1 no keep looking
1274 tra mak020-*
1275 rem
1276 rem now put associated device type into tib
1277 mak030 null
1278 lda tibadr-* virtualize tib address
1279 tsy a.i004-** setptw
1280 cax1 get it into x1
1281 qrl 9 align device type in q
1282 stq t.type1
1283 ldq mtemp+1-* get line number again
1284 stq t.line1 put it in tib
1285 lda a.i001-** ctrl pointer to start of control tables
1286 sta t.cur1 this is where interpreter will start
1287 rem
1288 ldx3 a.i001-* ctrl
1289 ldx3 13 addrarray of device table addresses
1290 adcx3 t.type1 index by device type
1291 ldx3 -13 convert index to offset
1292 rem x3 now points to relevant device table entry
1293 lda dt.flg3 find out how tfctrl should be set
1294 cana l.i001-* dtfctl
1295 tze mak040-* it's off to start with
1296 lda l.i002-* tfctrl
1297 orsa t.flg1 if dtfctl was on turn tfctrl on
1298 mak040 null
1299 lda dt.flg3 now check setting of dtfsft
1300 cana l.i004-* dtfsft
1301 tze mak050-*
1302 lda l.i005-* tfsftr get tib bit to set
1303 orsa t.flg21
1304 mak050 null
1305 iacx3 dt.brk get address of default break list
1306 stx3 t.brkp1 into tib
1307 rem
1308 lda metadr-* get address of metering area
1309 tsy a.i004-** setptw virtualize it
1310 sta t.metr1
1311 rem
1312 rem
1313 rem for asynchronous line take 2 32-word blocks
1314 rem for permanent input buffers if available.
1315 rem remainder of page is added to buffer pool
1316 rem
1317 lda mtemp-* synchronous line?
1318 cana l.i006-* =o400
1319 tze mak070-* yes don't bother with buffers
1320 lda hcurpg-* get address of next page base
1321 sba hnxstp-* find out how much space is left in page
1322 icmpa 2*bufsiz enough for two buffers?
1323 tnc mak070-* no skip it
1324 lda hnxstp-* get starting address
1325 sta t.abf01 this is first one
1326 caq
1327 tsy a.i004-** setptw
1328 cax2 make it addressable
1329 ila bufsiz get size in words
1330 als 9 store in first character
1331 sta 02
1332 iaq bufsiz point to next one
1333 stq t.abf11 address into tib
1334 iacx2 bufsiz virtual address also
1335 sta 02
1336 iaq bufsiz this is address of remaining space in the page
1337 szn a.i007-** is there any trace buffer?
1338 tnz mak058-* yes go ahead
1339 cmpq a.i008-** .crmem else see if it fits in memory
1340 tra 2
1341 mak058 cmpq a.i007-** .crtrb does it overlap trace buffer?
1342 tnc mak060-* no
1343 tze mak060-* also no but it's close
1344 die 1 yes image won't work
1345 mak060 lda l.i007-* tfabf0+tfabf1
1346 orsa t.flg31 mark them available
1347 cmpq hcurpg-* any space left in page?
1348 tze makbak-* no that's all
1349 stq hnxstp-* yes save address
1350 mak070 lda hnxstp-* get last available address
1351 iaa bufsiz-1 round it up to even bufsiz boundary
1352 iana -bufsiz
1353 sta hnxstp-* save it for size determination
1354 ldq hcurpg-* find end of page
1355 sbq hnxstp-* how much space is left?
1356 tze makbak-* none
1357 tnc makbak-* this is unlikely but check anyway
1358 tsy a.i006-** frebfh free what remains in the page
1359 makbak null that's all
1360 lda tibadr-* this is the real value where virtual value is
1361 rem is in the x1 register
1362 return maktib
1363 rem
1364 rem
1365 a.i001 ind ctrl control tables
1366 a.i002 ind getmem memory allocating subroutine
1367 a.i003 ind .crtte
1368 a.i004 ind setptw set up page table word
1369 a.i005 ind .crmet
1370 a.i006 ind frebfh
1371 a.i007 ind .crtrb
1372 a.i008 ind .crmem
1373 rem
1374 l.i001 vfd 18/dtfctl
1375 l.i002 vfd 18/tfctrl
1376 l.i003 oct 1000
1377 l.i004 vfd 18/dtfsft
1378 l.i005 vfd 18/tfsftr
1379 l.i006 oct 400
1380 l.i007 vfd 18/tfabf0+tfabf1
1381 rem
1382 even
1383 mtemp bss 2 place to put arguments
1384 tibadr bss 1 real address of allocated tib
1385 metadr bss 1 real address of allocated metering area
1386 ttls stopxx -- error notification routines
1387 rem
1388 rem
1389 stop ind **
1390 orsa badsts-* put error code in status
1391 ldq a.k001-** iomch get iom channel number
1392 stq badsts+1-* put it in bootload status
1393 iaa -2 no. get 2*message index
1394 als 1
1395 ada a.j001-* icws
1396 sta stp020-* this is the icw to be passed to wcon
1397 szn inhchn-* does message need channel number?
1398 tnz stp010-* no
1399 cax1 copy icw address
1400 lda 01 get message address
1401 ana l.j001-* =o077777 get rid of char addressing
1402 cax1
1403 tsy getchn-* get channel number for error message
1404 stq 31 store channel number in message
1405 rem
1406 stp010 null
1407 tsy a.k002-** iwcon write it on console
1408 stp020 zero ** icw address goes here
1409 nop don't fret if no console
1410 rem
1411 ldaq badsts-* notify cs of error
1412 tsy a.j003-** btsts
1413 dis just stop
1414 tra -1
1415 rem
1416 even
1417 badsts oct 440000000000
1418 rem
1419 rem
1420 stop02 null
1421 aos inhchn-* inhibit storing of channel no. in message
1422 ila 2
1423 tsy stop-*
1424 rem
1425 stop03 null
1426 aos inhchn-* inhibit storing of channel no. in message
1427 ila 3
1428 tsy stop-*
1429 rem
1430 stop04 null
1431 ila 4
1432 tsy stop-*
1433 rem
1434 stop05 null
1435 ila 5
1436 tsy stop-*
1437 rem
1438 stop06 null
1439 aos inhchn-* inhibit storing of channel no. in message
1440 ila 6
1441 tsy stop-*
1442 rem
1443 warn07 ind **
1444 tsy getchn-*
1445 stq msg07+2-*
1446 tsy a.k002-** iwcon
1447 zero icw07
1448 nop dont let lack of console screw us
1449 tra warn07-** return to caller
1450 rem
1451 stop08 null
1452 aos inhchn-*
1453 ila 8
1454 tsy stop-*
1455 rem
1456 stop09 null
1457 ila 9
1458 tsy stop-*
1459 rem
1460 stop10 null
1461 ila 10
1462 tsy stop-*
1463 rem
1464 stop11 null
1465 ila 11
1466 tsy stop-*
1467 rem
1468 stop12 null
1469 aos inhchn-* inhibit storing of channel no. in message
1470 ila 12
1471 tsy stop-*
1472 rem
1473 stop13 null
1474 ila 13
1475 tsy stop-*
1476 rem
1477 stop14 null
1478 aos inhchn-* inhibit storing of channel no. in message
1479 ila 14
1480 tsy stop-*
1481 rem
1482 stop15 null
1483 aos inhchn-* inhibit storing of channel no. in message
1484 ila 15
1485 tsy stop-*
1486 rem
1487 inhchn oct 0
1488 rem
1489 a.j001 ind icws
1490 *a.j002 unused
1491 a.j003 ind btsts
1492 rem
1493 l.j001 oct 077777 to eliminate character addressing
1494 eject
1495 rem *********************************************************
1496 rem * getchn -- get current iom channel number convert to
1497 rem * ascii code and place in q-register
1498 rem *********************************************************
1499 rem
1500 getchn ind **
1501 lda a.k001-** iomch get current iom channel number
1502 als 18-6 convert to ascii characters and leave
1503 ilq 6 in q-register
1504 llr 3
1505 qls 6
1506 iaq 6
1507 llr 3
1508 tra getchn-**
1509 rem
1510 a.k001 ind iomch
1511 a.k002 ind iwcon
1512 eject
1513 even
1514 icws null
1515 rem
1516 icw02 icw msg02-1b.028
1517 icw03 icw msg03-1b.032
1518 icw04 icw msg04-1b.030
1519 icw05 icw msg05-1b.030
1520 icw06 icw msg06-1b.030
1521 icw07 icw msg07-1b.032
1522 icw08 icw msg08-1b.040
1523 icw09 icw msg09-1b.040
1524 icw10 icw msg10-1b.042
1525 icw11 icw msg11-1b.040
1526 icw12 icw msg12-1b.038
1527 icw13 icw msg13-1b.044
1528 icw14 icw msg14-1b.036
1529 icw15 icw msg15-1b.036
1530 rem
1531 detail off
1532 rem
1533 vfd 9/cr9/lf
1534 msg02 aci 13timer channel not enabled
1535 vfd 9/cr9/lf
1536 msg03 aci 15more than one dia configured
1537 vfd 9/cr9/lf
1538 msg04 aci 13*ch-xx dia does not exist
1539 vfd 9/cr9/lf
1540 msg05 aci 13*ch-xx dia did not respond in time
1541 vfd 9/cr9/lf
1542 msg06 aci 15extended memory not configured
1543 vfd 9/cr9/lf
1544 msg07 aci 14*ch-xx lsla does not exist
1545 vfd 9/cr9/lf
1546 msg08 aci 18core image specifies too much memory
1547 vfd 9/cr9/lf
1548 msg09 aci 18*ch-xx illegal lsla speed specified
1549 vfd 9/cr9/lf
1550 msg10 aci 19*ch-xx lsla failed for the tenth time
1551 vfd 9/cr9/lf
1552 msg11 aci 18*ch-xx lsla actual <> desired speed
1553 vfd 9/cr9/lf
1554 msg12 aci 17timer switch set to 64 khz s/b 1
1555 vfd 9/cr9/lf
1556 msg13 aci 20*ch-xx actual config doesn't match cdt
1557 vfd 9/cr9/lf
1558 msg14 aci 16pager is disabled or inoperative
1559 vfd 9/cr9/lf
1560 msg15 aci 16unable to allocate trace buffer
1561 vfd 9/cr9/lf
1562 rem
1563 detail on
1564 ttls initialization main program -- wrap up
1565 ***********************************************************************
1566 *
1567 * all devices have now been initialized
1568 * all that remains is to open up the appropriate floodgates in an
1569 * orderly and meaningful sequence.
1570 *
1571 ***********************************************************************
1572 rem
1573 clocks null
1574 rem
1575 rem
1576 rem *********************************************************
1577 rem * if t&d executive channel is configured allocate a tib
1578 rem * for it. if in >32k we will keep the sfcm area and fake
1579 rem * an hsla table entry therein to store the real tib
1580 rem * address so the code in dia_man that finds the tib
1581 rem * table entry this way will work.
1582 rem *********************************************************
1583 rem
1584 szn a.m037-** .crtdt
1585 tze itl025-* line not configured
1586 tsy a.m039-** hgsfcm set up tib address
1587 sta csfcm-* save sfcm address
1588 lda l.m004-* =o412 give it a baud rate of 9600
1589 ldq l.m003-* =o1777 line number for colts
1590 tsy a.m038-** maktib
1591 sta a.m037-** save tib address in .crtdt
1592 ila ttcolt set line type
1593 sta t.type1
1594 lda csfcm-* get sfcm address back
1595 tsy a.m034-** setptw get virtual addr
1596 sta t.sfcm1 keep it for future reference
1597 cax2 we will pretend 2nd and 3rd words are
1598 iaa 1 hsla table entry
1599 sta sf.hsl2
1600 cax3 in order to save real tib address there
1601 lda a.m037-** .crtdt
1602 sta ht.tib3
1603 stx1 sf.tib2 just for cleanliness
1604 rem
1605 rem *********************************************************
1606 rem * send bootload status to cs. first we'll spin our wheels
1607 rem * for a second or so to give it time to process the
1608 rem * previous status
1609 rem *********************************************************
1610 rem
1611 itl025 ila 1
1612 ilq -1 aq contains 1777777 a good-sized loop index
1613 itl026 sbaq dbl1-* a doubleword 1
1614 tnz itl026-* keep going until it's zero
1615 ldaq gudsts-* get some good status
1616 tsy btsts-* send the bootload status
1617 rem
1618 inh inhibit interrupts <-><-><-><-><-><-><-><-><-><
1619 rem
1620 rem *********************************************************
1621 rem * restore level 0 1 and 2 interrupt vectors to their
1622 rem * operational settings
1623 rem *********************************************************
1624 rem
1625 ldx3 a.m030-* intv+256
1626 ldx2 a.m031-* savein+48-3
1627 rem
1628 itl030 null
1629 lda 02
1630 ldq 12
1631 staq -163
1632 lda 22
1633 sta -143
1634 iacx2 -3
1635 iacx3 -16
1636 tnz itl030-*
1637 rem
1638 lda a.m027-* consjt
1639 cmpa l.m001-* =o776 is console_man in image?
1640 tze itl040-* no. skip console stuff
1641 sta a.m028-** tytm yes. set up interrupt vectors for console
1642 iaa 3 now point to "special" jump table
1643 sta a.m029-** tyrq
1644 rem
1645 itl040 null
1646 eject
1647 rem ************************************************
1648 rem * now free all of init for use as buffer
1649 rem * space. note we will run in here for
1650 rem * awhile so we must be careful about allocating
1651 rem * buffers.
1652 rem ************************************************
1653 rem
1654 aos a.m017-** bfcksw suspend buffer size checking
1655 lda a.m020-** .crtte
1656 iaa bufsiz-1 round up to bufsiz boundary
1657 iana -bufsiz
1658 sta cbufr-* this will be beginning of buffer space
1659 rem
1660 ldq a.m001-** .crbuf old buffer area start
1661 sbq cbufr-* q contains total size
1662 cax3 point at which to be freed
1663 stx3 a.m001-** .crbuf so frebuf doesn't get upset
1664 tsy a.m013-** frebuf
1665 rem
1666 lda cbufr-* start of buffer space
1667 sba a.m020-** .crtte free space before first buffer
1668 icmpa 2 if at least 2 words we will use it
1669 tmi itl050-*
1670 ldx3 a.m020-** .crtte addr of small space
1671 caq
1672 stx3 a.m001-** .crbuf
1673 tsy a.m016-** fremem
1674 rem
1675 itl050 null now free the rest of extended memory
1676 rem one page at a time
1677 sti itlind-* save indicators
1678 ldi l.m002-* =024000o inhibit interrupt & overflow
1679 lda a.m041-** hcurpg
1680 itl052 ada l.m006-* =256 get address of end of page
1681 szn a.m042-** .crtrb is there any trace buffer?
1682 tze itl055-* no free whole page
1683 cmpa a.m042-** .crtrb overlaps trace buffer?
1684 tnc itl055-* no
1685 tze itl055-* not quite
1686 lda a.m042-** .crtrb
1687 sba a.m041-** hcurpg
1688 iana -bufsiz rounded to bufsize this is actual amount left
1689 tze itl058-* which isn't any
1690 tnc itl058-*
1691 caq get size in q
1692 tra itl056-*
1693 itl055 ldq l.m006-* =256 free whole page
1694 itl056 lda a.m041-** hcurpg
1695 tsy a.m043-** frebfh
1696 ada l.m006-* =256 next page address
1697 sta a.m041-** hcurpg
1698 cmpa a.m044-** .crmem
1699 tnc itl052-* if any more pages
1700 rem
1701 itl058 tsy a.m033-** fresml clean up small space
1702 nop dont care which return
1703 stz a.m018-** .crnbs number of buffers for small space
1704 stz a.m017-** bfcksw enable buffer checking
1705 rem
1706 lda a.m035-** .crnbf
1707 als bufshf get buffer pool size in words
1708 sta a.m036-** .mpool store where metering will find it
1709 ldi itlind-* restore previous indicators
1710 rem
1711 rem ********************************************************
1712 rem * start the control tables for each tib we created
1713 rem ********************************************************
1714 rem
1715 ldx2 a.m019-* tibtab get address of first entry in tib
1716 rem address table
1717 stx2 a.m012-** .crttb save it in system comreg
1718 rem
1719 itl060 null
1720 cmpx2 a.m020-** .crtte any more?
1721 tze itl070-* no
1722 lda 02 yes. get real tib address
1723 tsy a.m034-** setptw virtualize it
1724 cax1 get virtual tib address into x1
1725 tsy a.m014-** itest call test-state entry of interpreter
1726 iacx2 2 get address of next entry
1727 tra itl060-* get next entry
1728 rem
1729 itl070 null
1730 eject
1731 rem *********************************************************
1732 rem * setup the interval and elapsed timers
1733 rem *********************************************************
1734 rem
1735 stz a.m006-** itmb interval timer value = 0
1736 lda a.m007-* timrjt interval timer jump table
1737 sta a.m008-** tmro timer interrupt vector
1738 lda a.m021-** etrint get elapsed timer default value
1739 sta a.m009-** etmb
1740 lda a.m010-* etrip elapsed timer interrupt handler
1741 sta a.m011-** etr timer interrupt vector
1742 tsy a.m015-** rstclk turn clock off
1743 rem
1744 ldaq sdqdat-* schedule dummy rtn to kick off timer
1745 tsy a.m026-** dspqur since clock doesnt start til it is used
1746 rem
1747 rem *********************************************************
1748 rem * setup pointer to scheduler control blocks
1749 rem *********************************************************
1750 rem
1751 lda a.m022-* skdata addr of scheduler block
1752 sta a.m023-** .crskd store in .crskd
1753 lda a.m024-* icmdat addr of ic monitoring data
1754 cmpa l.m001-* =o776 is it configured?
1755 tze 2 no
1756 sta a.m025-** etrmon store addr in sked block
1757 rem
1758 rem *********************************************************
1759 rem * set a level 2 interrupt for the dia so it can run
1760 rem *********************************************************
1761 rem
1762 lda a.m005-** cdiaic get mask word for interrupt cell
1763 sic 2
1764 rem
1765 rem *********************************************************
1766 rem * set the interrupt enable mask register according to the
1767 rem * number of hsla's configured.
1768 rem *********************************************************
1769 rem
1770 ldx1 a.m003-** .crnhs
1771 adcx1 a.m032-* cenimk
1772 lda 01
1773 sier
1774 rem
1775 stz a.m004-** .crcon make sure console io enabled
1776 eject
1777 rem *********************************************************
1778 rem * well here goes everything
1779 rem *********************************************************
1780 rem
1781 eni enable interrupts <+><+><+><+><+><+><+><+><+><+
1782 rem
1783 tra 1* go to the main dispatcher "dis"
1784 ind msdsp
1785 eject
1786 rem
1787 a.m001 ind .crbuf addr of very 1st buffer
1788 *a.m002 unused
1789 a.m003 ind .crnhs number of hsla's configured
1790 a.m004 ind .crcon console io flag
1791 a.m005 ind cdiaic set interrupt cell word for dia
1792 a.m006 ind itmb interval timer mailbox addr
1793 a.m007 ind timrjt interval timer jump table addr
1794 a.m008 ind tmro interval timer iv addr
1795 a.m009 ind etmb elapsed timer mailbox addr
1796 a.m010 ind etrip elapsed timer interrupt handler
1797 a.m011 ind etr elapsed timer iv addr
1798 a.m012 ind .crttb
1799 a.m013 ind frebuf
1800 a.m014 ind itest "test-state" entry of interpreter
1801 a.m015 ind rstclk stop clock routine
1802 a.m016 ind fremem
1803 a.m017 ind bfcksw
1804 a.m018 ind .crnbs
1805 a.m019 zero tibtab pointer to current entry of tib address table
1806 a.m020 zero .crtte pointer to end of tib address table
1807 a.m021 ind etrint address of default elapsed timer value
1808 a.m022 ind skdata address of scheduler control block
1809 a.m023 ind .crskd
1810 a.m024 ind icmdat address of data in ic-monitor routine
1811 a.m025 ind etrmon pointer to icmdat in skdata
1812 a.m026 ind dspqur
1813 a.m027 ind consjt console_man jump tables
1814 a.m028 ind tytm console terminate iv
1815 a.m029 ind tyrq console special iv
1816 a.m030 zero intv+256
1817 a.m031 zero savein+48-3
1818 a.m032 zero cenimk
1819 a.m033 ind fresml
1820 a.m034 ind setptw set up variable cpu page table word
1821 a.m035 ind .crnbf number of free "buffers"
1822 a.m036 ind .mpool buffer pool size for metering
1823 a.m037 ind .crtdt t&d channel indicator later tib address
1824 a.m038 ind maktib
1825 a.m039 ind hgsfcm
1826 a.m040 ind hsflen
1827 a.m041 ind hcurpg
1828 a.m042 ind .crtrb
1829 a.m043 ind frebfh
1830 a.m044 ind .crmem
1831 rem
1832 l.m001 oct 776 address of missing module
1833 l.m002 oct 024000 inhibit interrupts & overflow
1834 l.m003 oct 1777 line number for colts pseudo-channel
1835 l.m004 oct 412 baud rate code for async 9600 baud
1836 l.m005 oct 100000 first address above 32k
1837 l.m006 dec 256
1838 even
1839 sdqdat vfd 12/606/1
1840 ind secdsp
1841 rem
1842 even
1843 gudsts oct 400000000000 bootloaded successfully status
1844 dbl1 dec 01 a doubleword 1 for subtracting from aq
1845 cbufr zero
1846 rem
1847 csfcm bss 1 "sfcm" for colts channel
1848 itlind bss 1 for safe-storing indicators
1849 rem
1850 cenimk oct 740000776000777700777774
1851 even
1852 clkonx oct 00
1853 ttls btsts - send bootload status to cs
1854 ************************************************************************
1855 * this routine will send status to the central system
1856 ************************************************************************
1857 btsts ind **
1858 staq .sstat-* save status to be sent
1859 lda intcel-* get interrupt cell word
1860 ana mbxmsk-* mask mailbox address
1861 iaa 6 add in relative location of status word
1862 sta stdcw1-* store in data transfer dcw
1863 rem
1864 lda intcel-* get execute interrupt cell to set
1865 arl 6 position it
1866 ana intmsk-* mask away extraneous bits
1867 orsa stdcw2+1-* store in interrupt dcw
1868 rem
1869 ldx1 lstsls-* get length of status dcw block
1870 ldx3 lstsl-* get pointer to dcw block
1871 tsy parity-* go calculate parity
1872 rem
1873 ldaq list-* get list icw pointer dia pcw
1874 staq ldimb-** store in pcw mailbox
1875 rem
1876 ila 2 set word count for parity calculation
1877 cax1
1878 ldx3 ldimb-* calculate dia parity for pcw mailbox
1879 tsy parity-*
1880 rem
1881 ldaq limodl-* get the list icw model
1882 staq stslst-* fill in for dia
1883 rem
1884 bts010 sel ** select the intercomputer channel
1885 cioc ldimb-** initiate i/o in dia channel
1886 dis wait for interrupt
1887 tra btsts-** return
1888 eject
1889 rem
1890 even
1891 .sstat dec 00 bootload status to go
1892 mbxmsk oct 007777 mailbox address mask
1893 intmsk oct 007700 interrupt cell mask
1894 ldimb ind dimb dia mailbox location
1895 lstsl ind stslst location of status list
1896 even
1897 list zero stslstw.2 pcw model - ptr to list icw
1898 oct 72 opcode - list operation
1899 rem
1900 limodl dcw stdcw16 bootload status list icw model
1901 stslst oct 00 place for list icw
1902 stdcw1 vfd 18/12/o6/75 data transfer fnp to cs dcw
1903 dcw .sstat1
1904 stdcw2 vfd 18/12/o6/73 interrupt cs dcw
1905 zero 0w.2
1906 oct
1907 stdcw3 vfd 18/12/o6/70 disconnect dcw
1908 zero 0w.2
1909 oct
1910 lstsls ind *-stslst length of status dcw block
1911 ttls calculate parity routine
1912 rem
1913 parity ind **
1914 ldq 03 get first word of dcw
1915 lda 13 get second word of dcw
1916 rem
1917 qlp 18 calculate parity for 1st word
1918 tnz 2 odd parity...
1919 ora parwd1-* even - set parity bit
1920 rem
1921 alp 18 calculate parity for 2nd word
1922 tnz 2 odd parity...
1923 ora parwd2-* even - set parity bit
1924 rem
1925 sta 13 restore 2nd word with parity bits
1926 rem
1927 iacx3 2 bump words pointer
1928 iacx1 -2 decrement word count
1929 tnz parity+1-* more to do
1930 rem
1931 tra parity-** return
1932 rem
1933 parwd1 oct 040000 parity bit for 1st word of dia dcw
1934 parwd2 oct 020000 parity bit for 2nd word of dia dcw
1935 rem beginning of free space while init is running
1936 intcel dec 0 interrupt cell passed by gicb
1937 ttls iwcon - common interface to wcon
1938 rem
1939 iwcon subr iwcx1
1940 szn a.n001-** conman is console_man in image?
1941 tze iwc020-* no. take error return
1942 lda iwcon-** yes. get icw address
1943 sta iwc010-* store it after tsy to wcon
1944 aos iwcon-* set up for error return
1945 tsy a.n002-** wcon write on console
1946 iwc010 zero ** icw address
1947 tra iwcret-* error return
1948 rem
1949 iwc020 null
1950 aos iwcon-* bump return address
1951 rem
1952 iwcret null
1953 return iwcon
1954 rem
1955 rem
1956 a.n001 ind conman
1957 a.n002 ind wcon
1958 ttls initialization main program
1959 rem
1960 rem
1961 rem *********************************************
1962 rem * gicb enters inti by way of
1963 rem * tra =istart-1*
1964 rem *
1965 rem * and passes:
1966 rem * the highest address in mcs in x2
1967 rem * the interrupt cell for the cs in x3
1968 rem * the dia iom channel in the a
1969 rem **********************************************
1970 rem
1971 stx3 a.t017-** intcel set interrupt cell
1972 istart null
1973 inh inhibit interrupts <-><-><-><-><-><-><-><-><-><
1974 rem
1975 sta a.t003-** diachn save dia i/o channel
1976 rem and derive terminate interrupt vector address
1977 als 4 which is 16*channel+2
1978 iaa 2
1979 sta a.t010-** diatmv
1980 rem
1981 rem **************************************************************
1982 rem * clear all unused configured memory including extended memory
1983 rem **************************************************************
1984 rem
1985 lda a.t008-** .crmem get memory size
1986 sta a.t007-** mvplmm set lower memory maximum address
1987 sta istpcl-* stops memory clear loop
1988 cmpa l.t002-* =32768 is last address above 32k?
1989 tnc a.t022-** stop06 no. we can't run this code
1990 lda l.t002-* =32768 yes. calculate last address in lower 32k
1991 iaa -1
1992 sta istpcl-* stops memory clear loop
1993 iaa -256 account for paging window
1994 iaa -256 and buffer window
1995 sta a.t007-** mvplmm set lower memory maximum address
1996 *
1997 * check pager operation
1998 *
1999 ldx1 l.t009-* get address of loc. 0
2000 lda 01 save its contents
2001 sta itloc0-*
2002 ila -1 put something recognizable there
2003 sta 01
2004 ldx1 l.t004-* window base of window
2005 stz 01 clear test cells
2006 stz -2561
2007 ldx3 a.t009-** .crpte
2008 lda l.t006-* =o100040 init page table to window page 77000
2009 sba l.t003-* =o400
2010 sba l.t003-* =o400
2011 sta 03
2012 lda a.t006-** .crcpt init cpu pager
2013 sta a.t004-** cptp
2014 ila -1 lets see where this goes
2015 sta 01 store test value
2016 stz 03 disable pager
2017 lda 01 this is the real 77400 has it changed?
2018 tnz itl120-* yes. bad news
2019 lda -2561 this is where store should go
2020 icmpa -1 is it correct?
2021 tnz itl120-* no. bad news
2022 rem
2023 itl100 null clear lower memory loop
2024 stz 02 clear one word
2025 iacx2 1 udate pointer
2026 cmpx2 istpcl-* is clearing finished?
2027 tnz itl100-* no. continue clear
2028 stz 02 yes. clear the last location
2029 rem
2030 lda a.t008-** .crmem get memory size
2031 iaa 1 yes. calculate stop for memory clear loop
2032 sta istpcl-*
2033 ldx1 l.t004-* window get pointer to paged address space
2034 ldx2 a.t009-** .crpte get address of variable page table entry
2035 lda l.t006-* =o100040 set up page table entry for window
2036 sta 02
2037 ldx3 l.t003-* =o400 set up counter
2038 lda iabsad-* absolute address value
2039 ldi l.t001-* inhibit overflow
2040 rem
2041 itl110 null clear one page of extended memory loop
2042 stz 01 clear one word
2043 cana l.t008-* =o077777 first word of a 32k block?
2044 tnz itl115-* no proceed
2045 stx1 itx1-* save contents of x1
2046 ldx1 l.t009-* zero
2047 szn 01 did we clobber loc. 0?
2048 tze a.t002-** stop08 yes there isn't this much memory
2049 ldx1 itx1-* restore x1
2050 itl115 iaa 1 increment absolute address value
2051 cmpa istpcl-* has the whole upper memory been written?
2052 tze itl140-* yes. extended memory clearing is done
2053 iacx1 1 no. increment page pointer
2054 iacx3 -1 done with this page?
2055 tze itl118-* yes set up for next
2056 stz 01 no. continue clearing
2057 tra itl115-*
2058 rem
2059 itl118 sta iabsad-* save absolute address value
2060 lda 02 current page table entry
2061 ada l.t003-* =o400 point to next page in upper memroy
2062 sta 02 hope the pager sees this
2063 lda iabsad-* restore absolute address value to A register
2064 ldx1 l.t004-* window re-init page pointer
2065 ldx3 l.t003-* =o400 re-init counter
2066 tra itl110-* do the next page
2067 rem
2068 itl120 null
2069 aos ipgerr-* remember paging error
2070 tra itl180-* init iv's for console write
2071 rem
2072 a.t001 ind setptw+1
2073 a.t002 ind stop08
2074 a.t003 ind diachn
2075 a.t004 ind cptp
2076 a.t006 ind .crcpt
2077 a.t007 ind mvplmm lower memory maximum address in utilities
2078 a.t008 ind .crmem memory size
2079 a.t009 ind .crpte
2080 a.t010 ind diatmv
2081 *a.t011 unused
2082 *a.t012 unused
2083 *a.t013 unused
2084 a.t014 ind stop14
2085 a.t016 ind .criom
2086 a.t017 ind intcel
2087 a.t019 ind figtre
2088 a.t020 ind hsflen
2089 a.t021 ind htibln
2090 a.t022 ind stop06
2091 rem
2092 l.t001 oct 024000 inhibit overflow and interrupts
2093 l.t002 dec 32768
2094 l.t003 oct 400
2095 l.t004 vfd 18/window
2096 l.t005 tra -1*
2097 l.t006 vfd 10/1283/15/0
2098 l.t007 nop
2099 l.t008 oct 077777
2100 l.t009 oct 0
2101 l.t010 oct 020000 inhibit interrupts only
2102 rem
2103 iabsad oct 100000
2104 ipgerr oct 0
2105 istpcl oct 0
2106 itcerr oct 0
2107 itx1 bss 1
2108 itloc0 bss 1
2109 itrcdm oct 0 dummy area used in case trace module is not
2110 rem configured
2111 rem
2112 pte.s bool 100 page table entry security bit
2113 window bool 77400
2114 rem
2115 even
2116 hfvi ind hfv fault vector images
2117 ind hfv+2
2118 ind hfv+4
2119 ind hfv+6
2120 ind hfv+8
2121 ind hfv+10
2122 ind hfv+12
2123 ind hfv+14
2124 eject
2125 rem
2126 itl140 null
2127 ila pte.s turn on 'security' bit in ptw so
2128 orsa 02 any reference to window will cause a store fault
2129 rem
2130 rem *********************************************************
2131 rem * set up some values for hgsfcm subroutine in init module
2132 rem *********************************************************
2133 rem
2134 ila t.leng get length of tib
2135 iaa 1 make it an even number of words
2136 iana -2
2137 sta a.t021-** htibln
2138 rem
2139 itl170 null
2140 ldx1 a.u007-* fltv move processor fault vector images to
2141 ldaq hfvi-* fault vector locations
2142 staq 01
2143 ldaq hfvi+2-*
2144 staq 21
2145 ldaq hfvi+4-*
2146 staq 41
2147 ldaq hfvi+6-*
2148 staq 61
2149 rem
2150 rem *********************************************************
2151 rem * get buffer routine metering area address
2152 rem *********************************************************
2153 rem
2154 lda a.u025-* addr getbfm
2155 sta a.u026-** .crbtm
2156 rem
2157 rem *********************************************************
2158 rem * if breakpoint_man in coreimage setup .crbrk
2159 rem *********************************************************
2160 rem
2161 lda a.u015-* brktab address of break control table
2162 cmpa l.u004-* =o776 valid not equal to 776
2163 tnz 2 yes ok
2164 ila 0 use 0 no break table
2165 sta a.u016-** .crbrk store in comm region
2166 eject
2167 rem *********************************************************
2168 rem * set up fig tree table pointers
2169 rem *********************************************************
2170 rem
2171 ldx1 a.t019-* figtre
2172 lda a.t016-** .criom get address of fig tree table
2173 asa 01
2174 asa 11
2175 rem
2176 itl180 null
2177 rem
2178 rem *********************************************************
2179 rem * if console_man is in coreimage turn on 'conman' switch
2180 rem *********************************************************
2181 rem
2182 lda a.u011-* wcon get address of entry point in console_man
2183 cmpa l.u004-* =o776 is console_man in image?
2184 tze itl190-* no
2185 ila -1 yes. turn on conman switch
2186 sta a.u014-** conman
2187 rem
2188 itl190 null
2189 rem
2190 rem *********************************************************
2191 rem * set up level 0 1 and 2 iv's so that "iom channel
2192 rem * faults" are trapped and all other's ignored. save
2193 rem * previous contents of these iv's for later restoration.
2194 rem *********************************************************
2195 rem
2196 ldi l.t010-* =o020000 resume permission of overflow faults
2197 ldx1 l.t009-* zero
2198 lda itloc0-* restore original contents of location 0
2199 sta 01
2200 ldx1 l.t003-* =o400 fill iom channel fault iv's
2201 lda a.u008-* iomflt with pointer's to "iomflt"
2202 sta -161
2203 iacx1 -16
2204 tnz -2
2205 rem
2206 ldx3 l.t003-* =o400 replace all zero iv's with a pointer
2207 lda a.u027-* ignore to an ignore interrupts routine
2208 itl200 null
2209 ldq -13
2210 tnz 2
2211 sta -13
2212 iacx3 -1
2213 tnz itl200-*
2214 rem
2215 ldx3 l.t003-* =o400 save present values of level 0 1 2
2216 ldx2 a.u024-* savein+48-3 interrupt vectors for restoration
2217 itl210 null
2218 ldaq -163 later
2219 sta 02
2220 stq 12
2221 lda -143
2222 sta 22
2223 ldaq ignrad-* set iv's to "ignore"
2224 staq -163
2225 sta -143
2226 iacx2 -3
2227 iacx3 -16
2228 tnz itl210-*
2229 rem
2230 lda l.u005-* =o700000 enable level 012 interrupts
2231 sier <-><+><-><+><-><+><-><+><-><+><-><+>
2232 rem
2233 ila 3*16+1 allow any interrupts waiting
2234 rem to cycle thru
2235 eni enable interrupts <+><+><+><+><+><+><+><+><+><+
2236 nop
2237 iaa -1 loop for a while to give them a chance
2238 tnz -2 to do their thing
2239 rem
2240 rem now run the idle loop for one metering interval
2241 rem to establish a counter value for an idle interval
2242 rem
2243 lda a.u017-* addr itl215
2244 sta a.u018-** etr direct timer interrupt to here
2245 ila 0 get negative interval size to set timer
2246 sba a.u019-** idlint
2247 sta a.u009-** etmb
2248 tra a.u020-** idloop run the idle loop till timer goes off
2249 rem
2250 itl215 ind ** elapsed timer runout comes here
2251 ldaq a.u021-** idlcnt
2252 staq a.u022-** idlmax this is maximum value
2253 staq a.u023-** idlmin and also minimum so far
2254 lda ignrad-* now ignore timer interrupts again
2255 sta a.u018-** etr
2256 ila 0 and clear the counter
2257 ilq 0
2258 staq a.u021-** idlcnt
2259 rem
2260 ldx1 l.t003-* =o400 fill iom channel fault iv's
2261 lda a.u008-* iomflt with pointer's to "iomflt"
2262 sta -161
2263 iacx1 -16
2264 tnz -2
2265 rem
2266 lda a.u010-** conchn initialize console terminate iv
2267 als 4
2268 cax1
2269 lda a.u012-* contip
2270 cmpa l.u004-* =o776 is console_man in image?
2271 tze itl220-* no. skip console stuff
2272 sta 21 yes. set up console terminate interrupt vector
2273 lda a.u013-** .crcon save console switch
2274 sta conswt-*
2275 stz a.u013-** .crcon zero switch so cr/lf goes through
2276 tsy a.u011-** wcon send cr/lf to console to unmask channel
2277 zero iwcrlf 9/cr9/lf
2278 nop don't loop if no console
2279 lda conswt-* restore .crcon
2280 sta a.u013-** .crcon
2281 rem
2282 itl220 null
2283 eject
2284 rem ***********************************************************
2285 rem * now that the console has been set up
2286 rem * check for fatal errors.
2287 rem ***********************************************************
2288 rem
2289 szn ipgerr-* was there a paging error?
2290 tnz a.t014-** stop14 yes. cannot continue
2291 rem
2292 rem
2293 rem ***********************************************************
2294 rem * check if timer is enabled and running
2295 rem ***********************************************************
2296 rem
2297 lda a.u009-** etmb get current value of elapsed timer
2298 ldq l.v002-* =1000 get two millisecond counter
2299 iaq -1 wait two milliseconds
2300 tnz -1
2301 cmpa a.u009-** etmb check and see if timer changed
2302 tnz itl230-* yes-ok
2303 tra 1* no. error...timer not enabled
2304 ind stop02
2305 rem
2306 rem
2307 rem ***********************************************************
2308 rem * check to make sure interval timer switch is set
2309 rem * to click every msec and not every 64th of a msec
2310 rem ***********************************************************
2311 rem
2312 itl230 null
2313 ila 2 set timer to go off in 2 msec
2314 ldq itl250-* ..
2315 tsy a.v018-** setclk
2316 ldq l.v001-* =250 get half millisecond counter
2317 iaq -1 wait half millisecond
2318 tnz -1 ..
2319 stz itl250-* if we finished counting timer is set to click
2320 rem every msec. set flag and wait for timer to go off
2321 dis
2322 itl240 ind stop12
2323 itl250 ind *+1 addr of place to go on timer interrupt
2324 ind **
2325 szn itl250-* did we finish counting above?
2326 tnz itl240-** no - timer sw is wrong - inform cs
2327 eject
2328 rem ***********************************************************
2329 rem * determine which iom channels are physically present.
2330 rem * save the results in word "exist" such that a one in
2331 rem * bit position "x" indicates that channel "x" exists.
2332 rem ***********************************************************
2333 rem
2334 itl260 null
2335 ilq 0 the q reg contains the status found so far
2336 ila 0 want x1 to hold current subch num -- but
2337 cax1 it needs to be loaded first
2338 rem
2339 ldx3 xstsav-* x3 will point to table of 16 readbacks
2340 rem
2341 itl270 null
2342 cx1a get the iom chan num into a reg
2343 ora l.v003-* sel 0 'or' in the sel instruction
2344 sta 1 put it where we will execute it
2345 sel ** altrd select the current iom chan
2346 stex itemp-* store this channel's static status
2347 lda itemp-* pick up the status status
2348 sta 03 save it in readback vector
2349 icmpa 0 by experiment non-existant channels
2350 rem * return 0 most others dont dia is exception
2351 tze 2 it doesn't exist dont turn on this bit
2352 iaq 1 it does exist turn on low order bit
2353 qls 1 move over to make room for next channel
2354 iacx1 1 add one to subchannel number
2355 iacx3 1 add one to readback vector loc
2356 cx1a get the subchannel number again
2357 icmpa 16 was it the last one
2358 tnz itl270-* no
2359 rem
2360 qls 1 move word over one more to left justify
2361 rem
2362 rem dia doesn't perform properly for experiment so...
2363 rem
2364 stq mexist-** save word where others can find it
2365 lda a.u028-** diachn get dia channel
2366 ora l.u006-* 'arl 0'
2367 sta itl275-* patch shift instruction
2368 lda l.u007-* =o400000 get bit to shift
2369 itl275 arl **
2370 orsa mexist-** update 'exists' word
2371 eject
2372 rem *********************************************************
2373 rem * send an initialize pcw to each hsla configured
2374 rem *********************************************************
2375 rem
2376 itl280 null
2377 szn a.u002-** .crnhs first are there any hsla's ??
2378 tze a.u004-** itl350 no don't bother with this code
2379 tra itl300-* skip over channel incrementation
2380 rem
2381 itl290 null * come here to increment to next channel
2382 aos a.u005-** iomch
2383 itl300 null
2384 lda a.u005-** iomch load iom channel
2385 als 1 multiply by two
2386 cax1 x1 <- 2 * iom ch #
2387 lda a.u006-** figtre* pick up 1st word of config tree
2388 arl 18-fcdevc-1 right justify the device type
2389 iana fbdevc mask out the rest of the word
2390 icmpa dhsla is it any hsla ??
2391 tnz itl310-* no jump out of this section
2392 rem * yes prepare to initialize it
2393 lda a.u005-** iomch pick up the iom channel #
2394 ora l.u003-* sel 0 'or' in a select instruction
2395 sta +1 store in where we will execute it
2396 sel ** this instruction patched above
2397 rem * select this hsla for operation
2398 rem
2399 rem * now check to see if this channel exists
2400 iana 15 mask out all but iom channel # =o17
2401 ora l.u002-* qls 0 'or' in 'qls' instruction
2402 sta +2 store where we will execute it
2403 ldq a.u003-** exist pick up word on which channels exist
2404 qls ** patched from above
2405 rem * move desired bit into sign bit
2406 tpl itl320-* doesn't exist the hsla initialization
2407 rem * will print out a message later
2408 rem
2409 rem * initialize this hsla
2410 rem * we need to hit it 4 times in case it's a 6670
2411 rem * with 4 mlcs pretending to be 1 hsla
2412 cioc ipcwa-* pcw1 cmd 10 subchannel 0
2413 cioc ipcwb-* " " " 8
2414 cioc ipcwc-* " " " 16
2415 cioc ipcwd-* " " " 24
2416 tra itl320-*
2417 rem
2418 itl310 null
2419 icmpa dclock is this the clock the clock must be
2420 rem * the last iom channel
2421 tze itl330-* yes go initialize the devices
2422 rem
2423 itl320 null * no go look for other hsla's
2424 tra itl290-*
2425 rem
2426 itl330 null
2427 lda l.u001-* =5000 set clock for 5 sec to allow hsla's
2428 ldq a.u001-* itl340 to finish
2429 tsy a.v018-** setclk wait here for clock to time out
2430 dis
2431 tra -1
2432 rem
2433 rem
2434 rem
2435 rem
2436 a.u001 ind itl340 jump over the following area of data
2437 a.u002 ind .crnhs number of hsla's configured
2438 a.u003 ind exist
2439 a.u004 ind itl350
2440 a.u005 ind iomch
2441 a.u006 ind figtre*
2442 a.u007 zero fltv fault vector base address
2443 a.u008 ind iomflt iom channel fault routine
2444 a.u009 ind etmb elapsed timer mailbox
2445 a.u010 ind conchn
2446 a.u011 ind wcon
2447 a.u012 ind contip
2448 a.u013 ind .crcon
2449 a.u014 ind conman
2450 a.u015 ind brktab address of table in breakpoint_man
2451 a.u016 ind .crbrk
2452 a.u017 ind itl215
2453 a.u018 ind etr elapsed timer interrupt vector
2454 a.u019 ind idlint idle metering interval in scheduler
2455 a.u020 ind idloop start of idle loop in scheduler
2456 a.u021 ind idlcnt counter incremented by idle loop in scheduler
2457 a.u022 ind idlmax maximum value of idlcnt in scheduler
2458 a.u023 ind idlmin minimum " " " " "
2459 a.u024 zero savein+48-3
2460 a.u025 ind getbfm
2461 a.u026 ind .crbtm
2462 a.u027 ind ignore
2463 a.u028 ind diachn
2464 rem
2465 l.u001 dec 5000
2466 l.u002 qls 0
2467 l.u003 sel 0
2468 l.u004 oct 776 a missing address
2469 l.u005 oct 700000
2470 l.u006 arl 0
2471 l.u007 oct 400000
2472 rem
2473 even
2474 ipcwa vfd 2/14/initop12/018/0 initialize pcw
2475 ipcwb vfd 2/14/initop6/86/018/0 same for second mlc
2476 ipcwc vfd 2/14/initop6/166/018/0 third
2477 ipcwd vfd 2/14/initop6/246/018/0 fourth
2478 rem
2479 rem
2480 rem
2481 itl340 ind **
2482 itl350 null
2483 stz a.u005-** iomch
2484 eject
2485 rem ***********************************************************
2486 rem * set up initial buffer space parameters.
2487 rem * we will allocate buffers starting at istart of init
2488 rem * but we will free the rest of init for use as buffer space
2489 rem * later. the code from istart to the end of init is no
2490 rem * longer needed.
2491 rem ***********************************************************
2492 rem
2493 lda a.v007-* istart-1 the begining of the end of init
2494 iaa bufsiz-1 round to buffer boundary
2495 iana -bufsiz
2496 cax3 address to free
2497 sta a.v020-** .crbuf starting addr of buffer area
2498 lda a.v023-* endtrc is trace module in image?
2499 cmpa l.u004-* =o776
2500 tnz itl360-* yes
2501 lda a.v012-* itrcdm no. fake out initialization of
2502 sta a.v019-* nxtrce trace module
2503 sta a.v023-* endtrc
2504 sta a.v025-* .crtrb
2505 sta a.v026-* .crtrc
2506 rem
2507 itl360 null
2508 lda a.v013-** mvplmm set up trace variables
2509 sta a.v023-** endtrc
2510 iaa 1
2511 rem
2512 itl370 null
2513 sba a.v020-** .crbuf base of current free buffer area
2514 tze a.v027-** stop15 there's no room left
2515 tnc a.v027-** stop15 bad news
2516 caq >0. ok. almost ready for frebuf
2517 *
2518 * finish up trace buffer allocation
2519 rem
2520 lda a.v022-** .crmem yes. put trace buffer at high
2521 rem end of configured memory
2522 sta a.v023-** endtrc
2523 sba a.v024-** .crtsz
2524 cmpa a.v023-** endtrc is there really a trace buffer?
2525 tze 2 no skip the addition
2526 iaa 1
2527 sta a.v025-** .crtrb
2528 sta a.v026-** .crtrc
2529 sta a.v019-** nxtrce
2530 cmpa l.v006-* =32768 is base above 32k?
2531 tnc a.v027-** stop15 no. cannot handle this
2532 rem
2533 itl380 null
2534 tsy a.v014-** frebuf free initial buffer space
2535 lda a.v008-* utsave
2536 sta a.v009-** .crreg save place where regs are saved
2537 lda a.v010-* tibtab init end of tib tab ptr
2538 sta a.v011-** .crtte so maktib can fill it in
2539 stz a.v006-** bfcksw enable buffer size checking
2540 rem
2541 tra 1*
2542 ind itl010 all set to pick the figtre
2543 eject
2544 rem
2545 diexst oct 020000 bit to be turned on to say dia exists
2546 mexist ind exist
2547 rem
2548 xstsav ind *+1 ptr to table of stex reads from devices
2549 bss 16
2550 even
2551 ignrad ind ignore ignore interrupts routine
2552 ind ignore
2553 rem
2554 iwcrlf icw l.v004b.02
2555 rem
2556 a.v006 ind bfcksw
2557 a.v007 ind istart-1
2558 a.v008 ind utsave
2559 a.v009 ind .crreg
2560 a.v010 ind tibtab
2561 a.v011 ind .crtte
2562 a.v012 ind itrcdm
2563 a.v013 ind mvplmm lower memory maximum address in utilities
2564 a.v014 ind frebuf
2565 *a.v015 unused
2566 *a.v016 unused
2567 *a.v017 unused
2568 a.v018 ind setclk
2569 a.v019 ind nxtrce in trace module next entry in trace buffer
2570 a.v020 ind .crbuf
2571 a.v021 ind .crpte variable cpu page table entry
2572 a.v022 ind .crmem last legal memory address
2573 a.v023 ind endtrc in trace module last word in trace buffer
2574 a.v024 ind .crtsz
2575 a.v025 ind .crtrb
2576 a.v026 ind .crtrc
2577 a.v027 ind stop15
2578 rem
2579 l.v001 dec 250 half of a millisecond in inst xec time
2580 l.v002 dec 1000 two milliseconds in inst xec time
2581 l.v003 sel 0
2582 l.v004 vfd 9/cr9/lf
2583 *l.v005 unused
2584 l.v006 dec 32768
2585 rem
2586 itemp bss 1
2587 conswt bss 1 temporary for .crcon
2588 end