1 * ***********************************************************
  2 * *                                                         *
  3 * * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4 * *                                                         *
  5 * ***********************************************************
  6           lbl       ,colts
  7           ttl        mclt multics hc fnp colts exec rev c 821015
  8           bci       2,821015
  9           cpr       1981
 10 *
 11 *
 12 * insert comments on purpose of module
 13 *
 14 *
 15           pcc       on
 16           pmc       off
 17           editp     on
 18           detail    on
 19           symdef    mclt
 20           symdef    colts
 21           symdef    tdip
 22           symref    begin
 23           symref    g3wjt
 24           symref    mdisp
 25           symref    secdsp
 26           symref    dspqur
 27           symref    getbuf
 28           symref    setbpt
 29           symref    frebuf
 30           symref    itest
 31           symref    gettib
 32           symref    setptw
 33           symref    denq
 34           symref    tdhung
 35           symref    cvabs
 36           pmc       save,on
 37 mclt      null
 38           start     mclt
 39           tib
 40           csbits
 41           tconst
 42           hwcm
 43           sfcm
 44           buffer
 45           global
 46           comreg
 47           ttls      test tib extension definitions
 48 *
 49           tibex     tb3wjt,word
 50           tibex     tbscid,word
 51           tibex     tbiflg,word
 52           tibex     tbaicw,word
 53           tibex     tbaiw2,word
 54           tibex     tbconf,word
 55           tibex     tbcnf2,word
 56           tibex     tberc1,word
 57           tibex     tberc2,word
 58           tibex     tbhcrb,word
 59           tibex     tbcbfs,word
 60           tibex     tbtmp1,word
 61           tibex     tbtmp2,word
 62           tibex     tbtmp3,word
 63           tibex     tbtmp4,word
 64           tibex     tbtcur,word
 65           tibex     tbrtib,word
 66           tibex     tbaux1,word
 67           tibex     tbvtib,word
 68           tibex     tbaux2,word
 69           tibex     tbbufr,word
 70           tibex     tbbufs,word
 71           tibex     tbmtal,word
 72           tibex     tbbtal,word
 73           tibex     tbspar,word
 74           tibex     tbsic1,word
 75           tibex     tbsice,word
 76 *
 77           pmc       restore
 78           ttls      colts executive line handler
 79 *
 80 colts     tstflg    tflisn,slisn
 81           wait      0,0,begin
 82 *
 83 slisn     signal    dialup
 84           wait      0,sendr,tshang
 85 *
 86 tshang    tstflg    tfhang,shang
 87           waitm
 88 *
 89 shangc    calasm    t6dis
 90 shang     signal    hangup
 91           goto      tdhung
 92 *
 93 sendr     clrflg    tfwrit
 94           calasm    tdac1
 95           tstflg    tfupsf,gtibex
 96 sndicm    calasm    tstc11
 97           tstflg    tfhang,shangc
 98           sendin
 99           signal    sndout
100           wait      0,sendr,tshngc
101 *
102 tshngc    tstflg    tfhang,shangc
103           waitm
104 *
105 gtibex    clrflg    tfupsf
106           getext    tibxsz,texerr
107           calasm    tstc3
108           goto      sndicm
109 texerr    calasm    tstc2
110           goto      sndicm
111 *
112           ttls      colts test page line handler
113 *
114 ctest     wait      0,schan,tchang
115 *
116 tchang    tstflg    tfhang,chang
117           waitm
118 *
119 chang     calasm    t6dtp
120           retext
121           signal    hangup
122           goto      tdhung
123 *
124 schan     clrflg    tfwrit
125           calasm    tdac2
126 schana    tstflg    tfofc,schanb
127           calasm    prcmes
128 stcht     setime    1
129           wait      timer,0,tchng
130 *
131 tchng     tstflg    tfhang,chang
132           tstflg    tfacu,timer
133           waitm
134 *
135 timer     setime    0
136           calasm    timprc
137 sndtes    tstflg    tfhang,chang
138           sendin
139           signal    sndout
140           goto      ctest
141 *
142 schanc    clrflg    tfwrit
143           calasm    tdac7
144           goto      schana
145 *
146 schanb    clrflg    tfofc
147           signal    sndout
148           wait      0,schanc,tthang
149 tthang    tstflg    tfhang,chang
150           waitm
151 *
152        ttls    process dac icm from 600
153 tdac1     subr      td1
154           lda       t.ocp,1   get outbuf ptr
155           sta       t.ocur,1  save as current
156           stz       t.ocp,1   clear orig ptr
157           iaa       2         step to start of icm
158           tsy       xsbpt-*,* set ptr in buff page table for icm base
159           sta       t.occh,1  save relative addr of icm
160           cax2                copy icm addr to index reg
161           lda       t600cd,2  get command code from icm
162           icmpa     toplx2    is it link nrx2?
163           tze       lnorx2-*  yes, go link it
164           icmpa     toplx1    is it link nrx1?
165           tze       lnorx1-*  yes, go link
166           ldx2      pnores-*  see if non-res exec already linked
167           tze       tdac8-*   no, bad news
168           icana     toplk2
169           tnz       lkmod2-*  go link tp submod2
170           icana     toplk1
171           tnz       lkmod1-*  go link tp submod1
172           icana     topsrt
173           tnz       tstc-*    go start test
174 tdac8     ila       topinv
175 prcend    sta       temp3-*   save reply code
176           ldx2      zerov-*
177           return    tdac1     return to op blocks
178 *
179 tstc9     ila       topgo     load op complete code
180           tra       prcend-*  and return
181        rem
182 rtdac9    ind       tdac9
183 *
184           ttls      process tp dac icm
185 *
186 prcmes    subr      pr2
187           ldx2      pnores-*  get nrx1 ptr
188           tsy       tpproc,2  process msg
189           icmpa     0         is it bad icm?
190           tnz       tpdac8-*  yes, send back icm
191           ldx2      dsp1bs-*  get tp submod ptr
192           lda       rtdac9-*  set up return from submod
193           sta       ep15,2    save ptr in submod
194           tra       ep11,2    go to submod icm decode
195 *
196 tdac9     null
197           ldx1      -tbvtib,1 restore test tib ptr
198           ldx2      t.elnk,1  get tib ext ptr
199           lda       -tbtmp2,2 get desired timer value
200           sta       stcht+1-* save for setime
201           ldx2      zerov-*
202           return    prcmes
203 *
204 tpdac8    ldx2      sndtst-*  get op block return ptr
205           return    prcmes
206 *
207 tdac2     subr      td2
208           ldx2      pnores-*  get nrx1 ptr
209           tsy       tpda2,2
210           ldx2      zerov-*
211           return    tdac2     return to op blocks
212 *
213 tdac7     subr      td7
214           ldx2      pnores-*  get nrx1 ptr
215           tsy       tpda7,2
216           ldx2      zerov-*
217           return    tdac7     return to op blocks
218 *
219        ttls    return icm to 600/6000
220 *
221 tstc11    subr      t11
222           ldx2      t.occh,1  get icm ptr
223           lda       temp3-*   get reply code
224           stz       temp3-*   clear temp loc
225           sta       t355cd,2  save reply in exec icm
226           ldx3      t.ocur,1  set up inp buff ptrs
227           stx3      t.icp,1   first buff addr
228           ldx3      t.olst,1  last buff addr
229           stx3      t.ilst,1
230           ldx3      t.ocnt,1  output buff count
231           stx3      t.icpl,1  use as input buff count
232           stz       t.ocur,1  clear pointers
233           stz       t.occh,1
234           ldx2      zerov-*
235           return    tstc11    return to op blocks
236 *
237 tstc2     subr      tc2
238           ila       topbuf    get buffer denial code
239           ldx2      zerov-*
240           return    tstc2     return to op blocks
241 *
242 tstc3     subr      tc3
243           ldx2      pnores-*  get ptr to nrx1
244           tsy       tptc3,2   set up test channel
245           ldx2      zerov-*
246           return    tstc3     return to op blocks
247 *
248 xsbpt     ind       setbpt    set buffer page base
249 xcvab     ind       cvabs     convert virtual to abs address
250 sndtst    ind       sndtes
251 pnores    ind       **        ptr to nrx1
252 zerov     oct       0
253        ttls    channel test request
254 *
255 tstc   null        initiate test start
256           ldx2      pnores-*  get nrx1 ptr
257           tsy       tptstc,2
258           icmpa     topinv    check for bad icm
259           tze       prcend-*  invalid icm
260           icmpa     topbuf    check for buffer denial
261 
262           tze       prcend-*  buff denial return
263           tra       tstc9-*   normal return
264 *
265        ttls    line dis connect processor
266 t6dis     subr      t6d
267           ldx2      pnores-*  get nrx1 addr
268           tze       t6ret-*   gone, so return
269           lda       tpmodu,2  get number of users
270           tze       t6ds1-*   none, so release nr exec
271           stx1      execfl-*  tp still active so set exec disc flag
272           tra       t6ret-*   return
273 t6ds1     tsy       relex-*   release nr exec
274 t6ret     ldx2      zerov-*
275           return    t6dis     return to op blocks
276 *
277 modrsl    zero
278           ldq       1,3       load size of buffer
279           qrl       10        position to num of wds
280           iaq       bufsiz    correct count
281           tsy       tdlblk-*,*          release it
282           tra       modrsl-*,*          return
283 *
284 relex     zero
285           ldx2      pnores-*  get nrx1 ptr
286           tze       relex-*,* nr exec gone so return
287           ldx3      tpxm2,2   get nrx2 ptr
288           tze       rlx1-*    already gone
289           tmi       rlx1-*    likewise
290           tsy       modrsl-*  release nrx2
291 rlx1      ldx3      pnores-*  get nrx1 ptr
292           tsy       modrsl-*  release nrx1
293           stz       pnores-*  clear ptr
294           tra       relex-*,* return
295 *
296 t6dtp     subr      t6p
297           ldx2      dsp1bs-*  get submod addr
298        tze     wrapup-*        submod 1 not loaded
299        szn     ep10,2          is part 2 loaded?
300        tpl     ep14,2          yes go to submod wrapup
301 wrapup inh
302           ldx2      pnores-*  get ptr to nrx1
303           tsy       tpdis,2   go finish disconnect
304           eni
305           lda       dsp1bs-*  get tp submod ptr
306           tnz       wrpend-*  tp still present
307           lda       execfl-*  tp gone,check if exec disc
308           tze       wrpend-*  exec still active
309           tsy       relex-*   release non res exec mods
310           stz       execfl-*  clear flag
311 wrpend    ldx2      zerov-*
312           return    t6dtp     return to op blocks
313 *
314 execfl    oct       0
315 *
316           ttls      link exec non-resident submods
317 *
318 lnorx1    null                link nrx1
319           szn       pnores-*  get possible ptr to nrx1
320           tnz       tstc9-*   already linked, return icm
321           tsy       mvblk-*   move to contig buffer
322           icmpa     0         check for normal return
323           tnz       prcend-*  bad news, buff denied
324           ldx2      temp3-*   get nrx1 ptr
325           stx2      pnores-*  save it
326           stx2      tpxm1,2   save in nrx1 also
327           ldaq      tdmdsp-*  set up ptrs in nrx1
328           staq      tpmdsp,2  mdisp,secdsp
329           ldaq      tdgbuf-*
330           staq      tpgbuf,2  getbuf,frebuf
331           lda       tdqur2-*
332           sta       tpdspq,2  dspqur
333           lda       tg3wjt-*
334           sta       tpg3w,2   g3wjt
335           lda       getadr-*
336           sta       tpgtib,2  gettib
337           lda       convad-*
338           sta       tpsptw,2  setptw
339           lda       iitest-*
340           sta       tpitst,2  itest
341           lda       sigsnd-*
342           sta       tpdenq,2  denq
343           lda       dsp1bp-*
344           sta       tpd1bs,2  dsp1bs
345           ldaq      tdsnp-*
346           staq      tpsnd,2   tdsnds,wrapup
347           lda       testop-*
348           sta       tpctst,2  ctest
349           lda       icktim-*
350           sta       tpchkt,2  cktime
351           lda       imodrl-*
352           sta       tpmrsl,2  modrsl
353           lda       xsbpt-*
354           sta       tpsbpt,2  setbpt
355           lda       xcvab-*
356           sta       tpcvab,2  cvabs
357 lnxret    stz       temp3-*   clear temp ptr
358           tra       tstc9-*   return icm
359 *
360 imodrl    ind       modrsl
361 *
362 lnorx2    null                link nrx2
363           ldx3      pnores-*  check if nrx1 linked
364           tze       tstc9-*   no, so return icm
365           szn       tpxm2,3   check if nrx2 already linked
366           tnz       tstc9-*   yes, return icm
367           tsy       mvblk-*   put in contig buffer
368           icmpa     0         check for bad return
369           tnz       prcend-*  bad news, buff denied
370           ldx2      pnores-*  get nrx1 ptr
371           lda       temp3-*   get nrx2 ptr
372           sta       tpxm2,2   link nrx2 to nrx1
373           tsy       tpinz,2   go to nrx1 init
374           tra       lnxret-*  return icm
375 *
376           ttls      pointers & entry points in nrx1
377 *
378 tpmdsp    equ       2         mdisp
379 tpsecd    equ       3         secdsp
380 tpdspq    equ       4         dspqur
381 tpg3w     equ       5         g3wjt
382 tpgbuf    equ       6         getbuf
383 tpfrbf    equ       7         frebuf
384 tpgtib    equ       8         gettib
385 tpsptw    equ       9         setptw
386 tpitst    equ       10        itest
387 tpdenq    equ       11        denq
388 tpxm1     equ       12        nrx1
389 tpxm2     equ       13        nrx2
390 tpsubm    equ       14        submod1
391 tpd1bs    equ       15        dsp1bs
392 tpsnd     equ       16        tdsnds
393 tpwrp     equ       17        wrapup
394 tpxtab    equ       18        abs addr xtib
395 tpmodu    equ       19        moduse
396 tpchkt    equ       20        cktime
397 tpsbpt    equ       21        setbpt
398 tpcvab    equ       22        cvabs
399 tpmrsl    equ       23        modrsl
400 tpctst    equ       24        ctest
401 *
402 tpip      equ       25        interrupt processor
403 *
404 tpinz     equ       27        non-res exec init
405 *
406 tpdis     equ       29        disconnect tp
407 *
408 tpda2     equ       31
409 *
410 tpda7     equ       33
411 *
412 tptstc    equ       35
413 *
414 tptc3     equ       37
415 *
416 tpls1     equ       39        link submod1
417 *
418 tpls2     equ       42        link submod2
419 *
420 tptim     equ       45        elapsed time proc
421 *
422 tpctm     equ       48        check timer
423 *
424 tpproc    equ       51        process msg
425 *
426 tpsen     equ       54        prepare icm for return
427 *
428        ttls    link t/d submodules
429 lkmod1 null    link submodule -1-
430           ldx2      pnores-*  get nrx1 ptr
431           tsy       tpls1,2   go link submod1
432           icmpa     0         ck for error
433           tnz       prcend-*  error, so exit
434           tra       tstc9-*   return icm
435 *
436 *
437 *      module -1- link address table
438 *
439 dsp1bs    ind       **        ptr to submod1
440 *
441 *
442 lkmod2 null    link submodule -2-
443           ldx2      pnores-*  get nrx1 ptr
444           tsy       tpls2,2   go link submod2
445           icmpa     0         ck for error
446           tnz       prcend-*  error, so exit
447           tra       tstc9-*   return icm
448 *
449 *
450 *      submodule 1 header format
451 *
452 ep0    equ     0               submodule data
453 ep1    equ     1               submodule data
454 ep2    equ     2               exec control
455 ep3    equ     3               exec control
456 ep4    equ     4               master dispatcher address
457 ep5    equ     5               event dispatcher address
458 ep6    equ     6               tib timeout dispatch address
459 ep7    equ     7               grts dispatch queuer address
460 ep8    equ     8               address of icm send routine
461 ep9    equ     9               exec return address after wrapup
462 ep10   equ     10              part 2 address and flag
463 ep11   equ     11              icm decode
464 ep12   equ     12              process interrupt
465 ep13   equ     13              process tib timeout
466 ep14   equ     14              test line wrapup
467 ep15   equ     15              initialize submodule (entered via tsy)
468 ep17      equ       17        ptr to getbuf
469 ep18      equ       18        ptr to frebuf
470 ep19      equ       19        ptr to setbpt
471 *
472        ttls    colts system symbols and definitions
473 tdispp bool    26              colts dispatcher priority
474 trlbkp bool    14              rellbf priority
475 tdmdspeind     mdisp           master dispatcher
476 tddisp ind     secdsp          secondary dispatcher
477 tdsnp eind     tdsnds          return icm to 600
478 tdwrp  ind     wrapup          exec return address after wrapup
479 timout    ind       timprc    test tib timeout processor ptr
480 tdqur2 ind     dspqur          dispatcher queuer
481 tdgbufeind          getbuf    ptr to getbuf
482 tdlblk ind     frebuf           frebuf address
483 *              define icm format
484 tmcksm equ     2               checksum word
485 tmcsta    equ       3         355 reply in test icm
486 t600cd equ     4
487 t355cd equ     5
488 tmcid1 equ     6
489 tmcid2 equ     7
490 tmcid3 equ     8
491 tmcid4 equ     9
492 tmcid5 equ     10
493 tmcid6 equ     11
494        rem     600 to 355 op-codes
495 topsrt bool    17
496 toplk1 bool    100
497 toplk2 bool    200
498 toplx1    bool      300       link nrx1
499 toplx2    bool      370       link nrx2
500        rem     355 to 600 op-codes
501 topgo  bool    41              operation complete op-code
502 topinv bool    42              invalid icm op-code
503 topact bool    45              channel active op-code
504 topdis bool    46              line disconnected op-code
505 topnlk bool    47              module not linked op-code
506 topbuf bool    50              bufferdenial op-code
507        ttls    test system interrupt processor
508 *
509 tdip   null
510           ldx2      pnores-*  get nrx1 ptr
511           tze       tdmdsp-*,*          no nrx1, exit to disp
512           tra       tpip,2    process interrupt
513 *
514 tg3wjt    ind       g3wjt     get 3rd word of jump table
515 *
516        ttls    time out processor
517 *
518 timprc    subr      tim
519           ldx2      pnores-*  get nrx1 ptr
520           tsy       tptim,2   go proc timer
521           lda       t.ocur,1  get abs addr icm buff
522           tsy       xsbpt-*,* set bpt for icm
523           ldx2      dsp1bs-*  get submod1 ptr
524           tnz       ep13,2    go proc tib timeout
525 tdsnds    null
526           ldx2      pnores-*  get nrx1 ptr
527           tsy       tpsen,2   go prepare icm for return
528           ldx2      zerov-*
529           return    timprc    return to op blocks
530 *
531 *
532 *
533 cktime    null
534           ldx2      pnores-*  get nrx1 ptr
535           tsy       tpctm,2   check elapsed time
536           ldx1      -tbrtib,3 get abs test tib addr
537           tra       tddisp-*,*          exit to secdsp
538 *
539 iitest    ind       itest
540 *
541 temp2     oct       0
542 temp3     oct       0
543 *
544        ttls    subroutine      - move icm to contiguous buffer
545 *
546 mvblk  zero
547           lda       0,2
548           sta       temp2-*   save total number 36-bit wds
549        als     1               convert to 18-bit wd count
550        iaa     bufsiz          force to next even bufsiz
551        iana    -bufsiz         mask residue
552        caq
553        tsy     tdgbuf-*,*      get system buffers - contiguous
554        tra     wtmem-*         no go joe
555           stx3      temp3-*   save addr for caller
556 mvblk4 ldaq    2,2             move the data
557        staq    2,3
558           iacx2     2         increment icm ptr
559        iacx3   2               increment block pointer
560        ila     -1              decrement move count
561        asa     temp2-*
562        tnz     mvblk4-*        not done yet
563           lda       zerov-*   set to zero for normal return
564        tra     mvblk-*,*       move complete
565        rem
566 wtmem  null    can't get contiguous buffers
567        ila     topbuf          denied buffers op-code
568           tra       mvblk-*,* return
569 *
570 *
571 *
572 dsp1bp    ind       dsp1bs
573 sigsnd    ind       denq
574 testop    ind       ctest
575 icktim    vfd       3/0,15/cktime
576 getadr    ind       gettib
577 convad    ind       setptw
578 *
579        rem
580        end