1 * ***********************************************************
  2 * *                                                         *
  3 * * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4 * *                                                         *
  5 * * Copyright (c) 1972 by Massachusetts Institute of        *
  6 * * Technology and Honeywell Information Systems, Inc.      *
  7 * *                                                         *
  8 * ***********************************************************
  9 
 10           lbl       gicb,gicb
 11           ttl       mcs/fnp intercomputer bootload routine
 12           ttls      copyright 1970 by honeywell information systems inc.
 13 ************************************************************
 14 *
 15 *  note:  cs means "central system"
 16 *
 17 ************************************************************
 18 *         change list
 19 *
 20 *         modified to run on dia by rbs june 24, 1972
 21 *         modified for multics boot of fnp by mjg may 25, 1976
 22 *
 23 ************************************************************
 24           pcc       on        print assembler control cards
 25           pmc       on        print macro expansions
 26           editp     on        print special edit control characters
 27           abs                 assemble in absolute format
 28           rem
 29 cksum     macro               checksum calculation macro
 30           ldx3      2         get return address
 31           tra       cksum-*   calculate checksum
 32           ind       *         location of 'here' and 'now'
 33           endm      cksum
 34           rem
 35 parity    macro     c,m       dia parity calculation macro
 36           ldx3      2         get location of dcw
 37           tsy       parity-*  call parity calculation routine
 38           ind       #1        location of dia dcw
 39           endm      parity
 40           rem
 41           systm               define system description symbols
 42           comreg
 43           ttls      intercomputer symbol definitions
 44           rem
 45           rem       dia icw symbol definitions
 46           rem
 47 csadd     equ       0         cs store address
 48 intopc    equ       1         interrupt cell and op-code
 49 fnpadd    equ       2         fnp address (36 bit data transfer)
 50 tally     equ       3         tally (36 bit words)
 51           rem
 52           rem       dia operation code symbol definitions
 53           rem
 54 diatrg    bool      65        transfer gate from cs to fnp
 55 diadis    bool      70        disconnect
 56 diainf    bool      71        interrupt fnp
 57 diajmp    bool      72        jump
 58 diainc    bool      73        interrupt cs
 59 diardc    bool      74        read configuration switches
 60 diaftc    bool      75        data transfer from fnp to cs
 61 diactf    bool      76        data transfer from cs to fnp
 62 diawrp    bool      77        wraparound
 63           ttls      datanet fnp hardware communication region
 64           rem
 65           rem       i n t e r r u p t   v e c t o r s
 66           rem
 67           rem
 68           rem                 channel 00 interrupt vectors
 69           rem
 70           vfd       3/w.2,15/*+2        bootload list icw
 71           vfd       3/0,1/1,1/1,13/2
 72           zero
 73           vfd       18/diadis disconnect dcw
 74           zero      0,w.2     with 36 bit xfer mode
 75           zero
 76           dup       1,10
 77           ind       .rtrn.    spring loaded interrupt vector
 78           rem
 79           rem                 channel 01 interrupt vectors
 80           rem
 81           ind       .icft.    iom fault vector
 82           dup       1,15
 83           ind       .rtrn.    spring loaded interrupt vector
 84           rem
 85           rem                 channel 02 interrupt vectors
 86           rem
 87           ind       .icft.    iom fault vector
 88           dup       1,15
 89           ind       .rtrn.    spring loaded interrupt vector
 90           rem
 91           rem                 channel 03 interrupt vectors
 92           rem
 93           ind       .icft.    iom fault vector
 94           ind       .rtrn.    spring loaded interrupt vector
 95           ind       .dia3.    entry for dia on channel 3
 96           dup       1,13
 97           ind       .rtrn.    spring loaded interrupt vector
 98           rem
 99           rem                 channel 04 interrupt vectors
100           rem
101           ind       .icft.    iom fault vector
102           ind       .rtrn.    spring loaded interrupt vector
103           ind       .dia4.    entry for dia on channel 4
104           dup       1,13
105           ind       .rtrn.    spring loaded interrupt vector
106           rem
107           rem                 channel 05 interrupt vectors
108           rem
109           ind       .icft.    iom fault vector
110           ind       .rtrn.    spring loaded interrupt vector
111           ind       .dia5.    entry for dia on channel 5
112           dup       1,13
113           ind       .rtrn.    spring loaded interrupt vector
114           rem
115           rem                 channel 06 interrupt vectors
116           rem
117           ind       .icft.    iom fault vector
118           dup       1,15
119           ind       .rtrn.    spring loaded interrupt vector
120           rem
121           rem                 channel 07 interrupt vectors
122           rem
123           ind       .icft.    iom fault vector
124           dup       1,15
125           ind       .rtrn.    spring loaded interrupt vector
126           rem
127           rem                 channel 08 interrupt vectors
128           rem
129           ind       .icft.    iom fault vector
130           dup       1,15
131           ind       .rtrn.    spring loaded interrupt vector
132           rem
133           rem                 channel 09 interrupt vectors
134           rem
135           ind       .icft.    iom fault vector
136           dup       1,15
137           ind       .rtrn.    spring loaded interrupt vector
138           rem
139           rem                 channel 10 interrupt vectors
140           rem
141           ind       .icft.    iom fault vector
142           dup       1,15
143           ind       .rtrn.    spring loaded interrupt vector
144           rem
145           rem                 channel 11 interrupt vectors
146           rem
147           ind       .icft.    iom fault vector
148           dup       1,15
149           ind       .rtrn.    spring loaded interrupt vector
150           rem
151           rem                 channel 12 interrupt vectors
152           rem
153           ind       .icft.    iom fault vector
154           ind       .rtrn.    spring loaded interrupt vector
155           ind       .dia14    entry for dia on channel 14(8)
156           dup       1,13
157           ind       .rtrn.    spring loaded interrupt vector
158           rem
159           rem                 channel 13 interrupt vectors
160           rem
161           ind       .icft.    iom fault vector
162           dup       1,15
163           ind       .rtrn.    spring loaded interrupt vector
164           rem
165           rem                 channel 14 interrupt vectors
166           rem
167           ind       .icft.    iom fault vector
168           dup       1,15
169           ind       .rtrn.    spring loaded interrupt vector
170           rem
171           rem                 channel 15 interrupt vectors
172           rem
173           ind       .icft.    iom fault vector
174           dup       1,15
175           ind       .rtrn.    spring loaded interrupt vector
176           eject
177           rem
178           rem       i n t e r r u p t   c e l l s
179           rem
180           dec       0         level  0
181           dec       0         level  1
182           dec       0         level  2
183           dec       0         level  3
184           dec       0         level  4
185           dec       0         level  5
186           dec       0         level  6
187           dec       0         level  7
188           dec       0         level  8
189           dec       0         level  9
190           dec       0         level 10
191           dec       0         level 11
192           dec       0         level 12
193           dec       0         level 13
194           dec       0         level 14
195           dec       0         level 15
196           rem
197           rem       i o m   f a u l t   s t a t u s
198           rem
199           dec       0         channel  0
200           dec       0         channel  1
201           dec       0         channel  2
202           dec       0         channel  3
203           dec       0         channel  4
204           dec       0         channel  5
205           dec       0         channel  6
206           dec       0         channel  7
207           dec       0         channel  8
208           dec       0         channel  9
209           dec       0         channel 10
210           dec       0         channel 11
211           dec       0         channel 12
212           dec       0         channel 13
213           dec       0         channel 14
214           dec       0         channel 15
215           eject
216           rem
217           rem       p r o c e s s o r   f a u l t   v e c t o r s
218           rem
219           ind       .falt.    startup fault
220           ind       .falt.    shutdown fault
221           ind       .falt.    memory parity fault
222           ind       .falt.    illegal operation code fault
223           ind       .falt.    overflow fault
224           ind       .falt.    illegal memory operation fault
225           ind       .falt.    divide check fault
226           ind       .falt.    illegal program interrupt fault
227           rem
228           rem       i o m   m a i l b o x   c o m m   r e g i o n
229           rem
230           dec       0         interval timer mailbox
231           dec       0         elapsed timer mailbox
232 diaind    dec       0         indicator storage area for checksum
233           dec       0
234           even
235 diasts    dec       0,0       bootload dia status storage area
236           vfd       3/w.2,15/diasts     dia status icw
237           vfd       3/0,1/0,1/1,1/1,12/2
238           ttls      load mcs/fnp system
239           rem
240 icbt10    null
241           ldaq      iclist-*  get list icw for mcs load
242           ldx1      l.trm2-*  set where to go after loading mcs/fnp
243           tra       diaioc-*  initiate mcs/fnp loading
244 .trm2     ind       **
245           rem
246           rem       check dia status from mcs/fnp read
247           rem
248           ldq       diasts+1-*          check second status word
249           tnz       icgtsr-*  bad status - e r r o r
250           rem
251           rem       compute checksum
252           rem
253           lda       iclmts+1-*          calculate length of mcs
254           sba       iclmts-*  *
255           cax1                move to index one
256           ldi       icindc-*  reset indicator storage
257           sti       diaind-*  *
258           tra       5         branch around zeroes
259           rem
260           dec       0         two words of zeroes that must be at loc
261           dec       0         474 & 475 so that pager won't be activated
262           dec       0         476-477 is dn6670 'yellow' counter and is
263           dec       0          incremented by one for each edac error
264           rem
265           ldx2      lmcs2-*   get starting location plus two
266           ldaq      .mcs.-*   get first two words
267           iacx1     -2        reduce length
268           cksum               calculate checksum for mcs/fnp
269           sbaq      icksma-*  compare cksum to that made by cs system
270           tnz       icgtcr-*  ***checksum error***
271           eject
272           rem
273           rem       move mcs/fnp system into position
274           rem
275           lda       iclmts+1-*          calculate end of mcs code
276           ada       lmcs-*    *
277           cax2                move to index two
278           sta       .mov1a-*  store start of .mov1 code
279           ldx1      s.mov-*   get beginning of move code
280           rem
281 icbt40    lda       0,1       move
282           sta       0,2       the
283           iacx1     1         move
284           iacx2     1         code
285           aos       l.mov-*   reduce counter
286           tnz       icbt40-*  not done, continue
287           rem
288           lda       icintn-*  get execute interrupt cell number
289           arl       3         shift off emergency int cell no.
290           als       12        position number
291           ora       dimbx-*   add in mailbox base address
292           cax3                move to index three
293           ldx2      iclmts-*  get the start of mcs
294           ldx1      lmcs-*    get where it is right now
295           tra       .mov1a-*,*          enter move one routine
296           eject
297           rem
298           rem       send unsuccessful bootload status to cs system
299           rem
300 icgtsr    null                dia status error when reading mcs
301           lda       .ssts2-*  set to store status error status
302           tra       icbt50-*
303 icgtcr    null                checksum error on mcs data
304           lda       .ssts1-*  set to store checksum error status
305           ilq       0         clear the q
306           tra       icbt50-*
307 dianfr    null                dia configuration error
308           ora       .ssts3-*  set to store configuration error status
309           stz       icepc-*   no exception processing for this one
310 icbt50    null
311           aos       icepc-*   reduce exception processing counter
312           tmi       icbt10-*  dont give up yet, reissue command
313           staq      .sstat-*  store status to be sent to cs
314           lda       dimbx-*   calculate location of bootload status
315           iaa       6         add offset of bootload status area
316           sta       stdcw1-*  store in data transfer dcw
317           lda       icintn-*  get execute interrupt cell to set
318           arl       3         shift off emergency int cell no.
319           als       6         position cell number
320           orsa      stdcw2+1-*          store in interrupt dcw
321           ldx1      lstsls-*  get length of status dcw block
322           parity    stslst    calculate parity for status dcw's
323           ldaq      stslst-*  get list icw for status store
324           ldx1      l.trm3-*  set where to go after storing status
325           tra       diaioc-*  store bad status of the bootload
326           eject
327           rem
328           rem       checksum calculation routine
329           rem
330 cksum     null
331           ldi       diaind-*  get the indicators
332           tnc       2         test for carry
333           adaq      diary-*   carry. simulate awc instruction
334           adaq      0,2       add in next word
335           sti       diaind-*  save indicators
336           iacx2     2         bump data pointer
337           iacx1     -2        reduce counter
338           tnz       cksum-*   continue to end of block
339           tra       1,3       return
340           rem
341           rem       initiate i/o on dia channel
342           rem
343 diaioc    staq      list-*    set list icw mailbox
344           lda       dialst-*  get pointer to list icw
345           ilq       56        get command of 70 for pcw
346           staq      dimb-*    store in pcw mailbox
347           stx1      lditm-*,* set terminate vector
348           ila       2         set word count for parity check
349           cax1                *
350           parity    dimb      calculate dia parity for pcw mailbox
351           cioc      dimb-*    initiate i/o in dia channel
352           dis                 wait for interrupt
353           tra       -1        *
354           rem
355           rem       calculate dia parity
356           rem
357 parity    ind       **        return address
358           ldq       0,3       get first word of dcw
359           lda       1,3       get second word of dcw
360           qlp       18        calculate parity for 1st word
361           tnz       2         odd parity...
362           ora       parwd1-*  even - set parity bit
363           alp       18        calculate parity for 2nd word
364           tnz       2         odd parity...
365           ora       parwd2-*  even - set parity bit
366           sta       1,3       restore second word with parity bits
367           iacx3     2         bump pointer to next pair of words
368           iacx1     -2        decrement word count
369           tnz       parity+1-*          more to do
370           aos       parity-*  increment return pointer
371           tra       parity-*,*          and return
372           ttls      constants and buffers
373           rem
374 list      equ       298       list icw storage
375           rem
376 stslst    dcw       stdcw1,6  send bootload status list icw
377 stdcw1    vfd       18/,18/diaftc       data transfer fnp to cs dcw
378           dcw       .sstat,1
379 stdcw2    vfd       18/,18/diainc       interrupt cs dcw
380           zero      0,w.2
381           zero
382           vfd       18/,18/diadis       disconnect dcw
383           zero      0,w.2
384           zero
385 lstsls    ind       *-stslst  length of status dcw block
386           rem
387 icepc     dec       -3        exception processing counter
388           rem
389           even
390 diary     dec       0,1       cksum carry constant
391 icindc    oct       024000    indicator register constant
392 lditm     ind       **        location of dia terminate vector
393           rem                 (filled in depending on which one gets used)
394           rem
395 parwd1    oct       040000    parity bit for 1st word of dia dcw
396 parwd2    oct       020000    parity bit for 2nd word of dia dcw
397           rem
398           even
399 .sstat    oct       400000,000000       status for successful bootload
400 .ssts1    oct       410000    status for checksum error on bootload
401 .ssts2    oct       420000    status for bad status on bootload
402 .ssts3    oct       430000    status for configuration error
403           rem
404 l.trm2    ind       .trm2     terminate vector when reading mcs/fnp
405 l.trm3    ind       icbtsp-1  terminate vector for storing status
406           rem
407 .mcs.     equ       512       loading base for mcs/fnp system
408 lmcs      ind       .mcs.     base of mcs/fnp system
409 lmcs2     ind       .mcs.+2   location of mcs/fnp loading base + two
410 dialst    ind       list,w.2  location of  list icw with 36 bit xfer
411           rem
412           eject
413           rem
414           rem       move program
415           rem
416 mvllmt    equ       *-4       low limits of mcs
417 mvhlmt    equ       *-3       high limit of mcs
418 mvwdct    equ       *-2       word count for mcs
419 mventy    equ       *-1       entry point for mcs
420           rem
421 .mov1     ldq       0,1       move mcs/fnp system
422           stq       0,2       *
423           iacx1     1         bump load pointer
424           iacx2     1         bump store pointer
425           cmpx1     .mov1a-*  everything moved?
426           tnz       .mov1-*   no. continue moving
427           lda       movchn-*  yes. pass dia channel to init routine
428           ldx2      mvhlmt-*  also upper limit of mcs for clearing memory
429           ldx1      mventy-*  get entry point of mcs
430           tra       -1,1      enter mcs
431 .mov1a    ind       **        location of .mov1 at end of mcs program
432           rem
433 movchn    oct       0         dia channel will be stored here
434 s.mov     ind       .mov1     location  of the beginning of move code
435 l.mov     vfd       18/-movchn+.mov1-1  length of move code (negated)
436           eject
437           rem
438           rem
439           rem       * * * * * * * * * * * * * * * * * * * * * * * * * * * *
440           rem       *  n.b.  the following org means one must be very careful
441           rem       *        when adding code above loc 722 (8)
442           rem       * * * * * * * * * * * * * * * * * * * * * * * * * * * *
443           rem
444           org       466
445           rem
446 .icft.    ind       **        dia channel fault
447           dis       1         stop on iom fault
448           tra       -1
449           rem
450 .falt.    ind       **        processor fault
451           dis       2         stop on fault
452           tra       -1
453           rem
454 icser     dis       3         bad dia status on bootload
455           tra       -1        stop on bad status
456           rem
457 diaksr    dis       4         checksum error on bootload data
458           tra       -1        stop on checksum error
459           rem
460 icbtsp    dis       5         unsuccessful bootload attempt
461           tra       -1        stop on unsuccessful bootload
462           rem
463 .rtrn.    ind       **        spring loaded vector for
464           tra       -1,*      extraneous interrupts
465           ttls      future site of bootload communication block
466           rem
467           org       480
468           rem
469           dup       1,32      reserve communication area
470 btcomm    dec       0
471           ttls      cs bootload validation
472           rem
473           org       512
474           rem
475 .dia3.    ind       **        entry when dia is on channel 3
476           ila       3
477           sta       diachn-*
478           stz       .dia3.-*  so as not to gum up checksum
479           tra       .icbt.-*
480           rem
481 .dia4.    ind       **        entry when dia is on channel 4
482           ila       4
483           sta       diachn-*
484           stz       .dia4.-*  so as not to gum up checksum
485           tra       .icbt.-*
486           rem
487 .dia5.    ind       **        entry when dia is on channel 5
488           ila       5
489           sta       diachn-*
490           stz       .dia5.-*  so as not to gum up checksum
491           tra       .icbt.-*
492           rem
493 .dia14    ind       **        entry when dia is on channel 14 (8)
494           ila       12
495           sta       diachn-*
496           stz       .dia14-*  so as not to gum up checksum
497           tra       .icbt.-*
498           rem
499 .icbt.    null                start of bootload program
500           rem
501           rem       check dia status from bootload
502           rem
503           ldq       diasts+1-*          check second status word
504           tnz       icser-*   bad status means bad bootload
505           rem
506           rem       compute checksum
507           rem
508           rem
509           ldi       icindc-*  reset indicator storage word
510           sti       diaind-*  *
511           stz       .rtrn.-*  reset interrupt spring vector
512           ldx2      sintv2-*  get the start of the interrupt vectors
513           ldaq      intvc-*   get the first words which were there
514           ldx1      diant1-*  get the first cksum counter
515           cksum               calculate cksum 1/4
516           ldx1      diant2-*  get second cksum counter
517           ldx2      sfltst-*  start of fault status words
518           cksum               calculate cksum 2/4
519           ldx1      diant3-*  get third cksum counter
520           ldx2      sdiast-*  location of dia status icw
521           cksum               calculate cksum 3/4
522           ldx1      diant4-*  get fourth cksum counter
523           ldx2      sdimb4-*  location of dia dcw mailbox plus four
524           cksum               calculate cksum 4/4
525           staq      temp-*    save checksum
526           eject
527           rem
528           rem       move bootload communication region
529           rem
530           ldx1      ltbtcm-*  get pointer to temporary comm region
531           ldx2      lbtcom-*  get pointer to permenant comm region
532           ilq       -32       set counter
533 btcmov    lda       0,1       move bootload
534           sta       0,2       communication block
535           iacx1     1         increment
536           iacx2     1         block pointers
537           iaq       1         reduce counter
538           tnz       btcmov-*  continue
539           rem
540           rem       store dia channel in saved indicators and set
541           rem       dia interrupt vector
542           rem
543           lda       diachn-*  get channel number
544           sta       movchn-*  put it where it can be found by move routine
545           orsa      icindc-*  put it in select register portion of indicators
546           ldi       icindc-*  set the indicators
547           als       4         convert to interrupt vector address
548           iaa       2
549           sta       lditm-*   save it
550           rem
551           rem       check bootload checksum
552           rem
553           ldaq      temp-*    get checksum
554           sbaq      icksmb-*  compare cksum to that made by cs
555           tnz       diaksr-*  ...checksum error...
556           ldx2      sintv2-*  get pointer to start of interrupt vector
557           ldaq      14,2      reset vectors used during bootload
558           staq      -2,2      *
559           ldaq      12,2      *
560           staq      0,2       *
561           staq      2,2       *
562           eject
563           rem
564           rem       read dia configuration
565           rem
566           ldx1      lcnfls-*  get length of configuration dcw block
567           parity    cnflst    calculate parity for configuration dcw's
568           ldx1      l.trm1-*  set return address for terminate from
569           ldaq      cnflst-*  get configuration list icw
570           tra       diaioc-*  the configuration read & go initiate i/o
571           rem
572 .trm1     ind       **
573           ldq       csmbx-*   get the mailbox address from the switches
574           lda       csics-*   get the interrupt cell number
575           cmpq      dimbx-*   is it the same as the cs said?
576           tnz       dianfr-*  no. configuration error
577           rem
578           cmpa      icintn-*  compare interrupt cell switches
579           tnz       dianfr-*  no good, report error
580           rem
581           tra       lbt10-*,* all ok so far, load mcs
582           rem
583 lbt10     ind       icbt10    location of the mcs load routine
584           rem
585 ltbtcm    ind       tbtcom    location of temporary boot comm region
586 lbtcom    ind       btcomm    location of permanent boot comm region
587           even
588 temp      dec       0,0       temporary storage
589           rem
590           rem       dia configuration data area
591           rem
592           even
593 config    null
594 cspab     oct                 port a and port b
595 cspcd     oct                 port c and port d
596 csmbx     oct                 cs mailbox address
597 csics     oct                 cs interrupt cell switch
598 cslwa     oct                 lower address bounds switches
599 csupc     oct                 upper address bounds switches
600           bss       2
601           eject
602 sintv2    ind       intv+2    location of interrupt vectors plus two
603 sfltst    ind       fltst     location of iom fault status words
604 sdiast    ind       dist      location of dia status icw
605 sdimb4    ind       dimb+4    location of dia pcw mailbox plus four
606 diant1    dec       254       cksum counter for interrupt vector area
607 diant2    dec       24        cksum counter for flt vctrs & flt status
608 diant3    dec       2         cksum counter for dia status icw
609 diant4    ind       end-icbt10-2        cksum counter for bootload program
610           rem
611 cnflst    dcw       *+2,4     configuration list icw
612           vfd       18/,18/diardc       read configuration dcw
613           dcw       config,4
614           vfd       18/,18/diadis       disconnect dcw
615           zero      0,w.2
616           zero
617 lcnfls    ind       *-cnflst  length of configuration dcw block
618           rem
619           rem
620 l.trm1    ind       .trm1     terminate vector for configuration read
621           even
622 intvc     vfd       3/w.2,15/2          first words of interrupt vector area
623           vfd       3/0,1/1,1/1,13/2
624           rem
625           rem
626           date
627           ttls      bootload communication block
628           rem
629 tbtcom    even
630 end       equ       *+32      last location to be included in checksum
631           rem                 of bootload program
632           loc       480
633           rem
634           rem       mcs/fnp list icw control block
635           rem
636 iclist    dcw       icdcw1,** list icw
637 icdcw1    vfd       18/,18/diactf       dcw number one
638           vfd       3/w.2,15/.mcs.      load 0 - 8k
639           vfd       6/0,12/0
640 icdcw2    vfd       18/,18/diactf       dcw number two
641           vfd       3/w.2,15/.mcs.+8192 load 8 - 16k
642           vfd       6/0,12/0
643 icdcw3    vfd       18/,18/diactf       dcw number three
644           vfd       3/w.2,15/.mcs.+16384 load 16 - 24k
645           vfd       6/0,12/0
646 icdcw4    vfd       18/,18/diactf       dcw number four
647           vfd       3/w.2,15/.mcs.+24576 load 24 - 32k
648           vfd       6/0,12/0
649 icdcw5    vfd       18/,18/diadis       dcw number five - disconnect
650           vfd       18/0,18/0
651 dimbx     dec       0         cs mailbox address
652 icintn    dec       0         cs interrupt cells
653           dec       0,0       unused
654 iclmts    dec       0,0       mcs load limits
655 icksma    dec       0,0       mcs checksum
656 icksmb    dec       0,0       bootload checksum
657           rem
658           org       end
659 diachn    oct       0         dia channel number is deliberately stored
660           rem                 outside checksum area
661           end