
      HED 2000F (OPTION 205) SYSTEM TABLE DUMP
* 
*  TAPE LABEL 
* 
DSCLB ASC 4,COLDDUMP
      DEC 3000      2000F (OPT. 200/205) SYSTEM CODE
      SPC 3 
      ORG 76300B
* 
*  ATTEMPT TO PROTECT COLD DUMP FROM RUNAWAY SYSTEM 
* 
      REP 16
      HLT 0 
      SKP 
* 
*  RESTORE SYSTEM DISC DRIVER 
* 
DSC11 LDA DS1MB     READ
      STA DSDT3       FINAL 
      LDA DSBFI         DISC
      STA DSDT4           BOOTSTRAP 
      CLB                   FROM
      CLA,INA                 LOGICAL UNIT 0
      JSB DSDRD                 (BLOCKS 1 & 2)
* 
      LDA DS1M      READ
      STA DSDT3       SYSTEM
      LDA DSDDA         DISC
      STA DSDT4           DRIVER
      DLD DSB63             (ADDRESS
      SWP                     FROM
      JSB DSDRD                 SST)
* 
      CLA 
      STA MBUSY     CLEAR 'DISC BUSY' FLAG
      STA DSMFL,I   SUPPRESS DISC ERROR MESSAGES
      LDA DSMHA     RESTORE ADDRESS OF
      STA MHAD        DRIVER'S DISC TABLE 
      DLD DSDIN     RESTORE DRIVER
      DST DISCA       ENTRY POINTS
      LDA DSM8
      STA DSDT0 
      LDA DSFBA     ADDRESS OF FINAL BOOTSTRAP'S
      STA DSDT1       UNIT # / SELECT CODE  TABLE 
      LDB DSDTB     => BASE PAGE DISC TABLE 
* 
DSC12 LDA DSDT1,I   RESTORE NEXT
      STA 1,I         LOGICAL DISC ENTRY
      SZA,RSS       DOES UNIT EXIST?
      JMP DSC13     NO
      ALF,ALF       YES, ISOLATE
      INA             COMMAND CHANNEL 
      AND DSB77         SELECT CODE 
      STA DSDT2     RESTORE 
      LDA DSDSB       INTERRUPT 
      STA DSDT2,I       LOCATION
DSC13 INB           MORE
      ISZ DSDT1       LOGICAL 
      ISZ DSDT0         UNITS?
      JMP DSC12     YES 
      SPC 2 
* 
*  ATTEMPT TO DUMP SWAP TRACKS
* 
      LDA DSMSL     SET 10240 AS
      STA DSDT1       MAXIMUM TABLE LENGTH
      LDA DSM32     SET FOR 32
      STA DSDT0       SWAP TRACKS 
      STA MWORD     SET MWORD TO -32
      LDA DSB13     READ SYSTEM-LOADER
      JSB DSDSD       LINKAGE TABLE 
      JMP DSC15     DIDN'T GET IT 
      LDA DSBF7     SAVE ADDRESS
      STA DSDT2       OF SWAP AREA
      DLD DSBF2     SAVE LENGTH OF
      STA DSDT3       TELETYPE TABLE ENTRY
* 
DSC14 STB DSDT4     => NEXT SWAP TRACK ADDRESS
      ADB DSM1      WRITE WORDS 
      LDA DSM4        1-4 OF
      JSB DSMTD         TELETYPE TABLE
      LDA DSDT4     LOAD
      ADA DS.2
      LDB 0,I         'PBPTR' 
      CMB           COMPUTE SIZE
      ADB DSDT2       OF SWAP AREA
      LDA DSDT4     POINTER TO DISC ADDRESS 
      JSB DSRWT     ATTEMPT WRITE OF SWAP TRACK 
      ADB DSDT3     MOVE TO NEXT PORT 
      ISZ DSDT0     DONE? 
      JMP DSC14     NO
* 
DSC15 JSB DSEDF     WRITE EOF SEQUENCE
      SPC 2 
* 
*  ATTEMPT TO DUMP FUSS TABLE 
* 
      DLD DSLLC     LOAD SYSTEM LIBRARY DISC ADDRESS
      CLE,INB       INCREMENT 
      SEZ             BY ONE
      INA               BLOCK 
      DST DSDT2     STORE FUSS TABLE DISC ADDRESS 
      LDA DSLLA     POINTER TO DISC ADDRESS (DSDT2) 
      LDB DS1M      FUSS TABLE LENGTH 
      JSB DSRWT     ATTEMPT TO WRITE FUSS TABLE 
      SPC 2 
* 
*  ATTEMPT TO DUMP DIRECTORY
* 
      LDA DS8K      SET 8192 AS 
      STA DSDT1       MAXIMUM TABLE LENGTH
      LDA DSM80     SET FOR 80
      STA DSDT0       DIRECTORY TRACKS
      LDB DSDIR     => DIREC TABLE
* 
DSC16 STB DSDT4     => NEXT DIREC ENTRY 
      LDA DSM7      WRITE IT TO 
      JSB DSMTD       MAG TAPE
      LDA DSDT4     LOAD LENGTH 
      LDB 0,I         OF NEXT TRACK 
      ADA DS.5      => DISC ADDRESS 
      JSB DSRWT     ATTEMPT WRITE OF DIRECTORY TRACK
      ADB DS.7      ADVANCE TO NEXT DIREC ENTRY 
      ISZ DSDT0     DONE? 
      JMP DSC16     NO
* 
      JSB DSEDF     WRITE EOF SEQUENCE
      SPC 2 
* 
*  ATTEMPT TO DUMP IDT
* 
      LDA DSM3      SET FOR 3 
      STA DSDT0       IDT TRACKS
      LDB DSIDT     => IDEC 
* 
DSC17 STB DSDT4     => NEXT IDEC ENTRY
      LDA DSM4      WRITE IT TO 
      JSB DSMTD       MAG TAPE
      LDA DSDT4     LOAD LENGTH 
      ADA DS.3        OF NEXT 
      LDB 0,I           ID TRACK
      ADA DSM2      => DISC ADDRESS 
      JSB DSRWT     ATTEMPT WRITE OF ID TRACK 
      ADB DS.4      ADVANCE TO NEXT IDEC ENTRY
      ISZ DSDT0     DONE? 
      JMP DSC17     NO
* 
      JSB DSEDF     WRITE EOF SEQUENCE
      SPC 2 
* 
*  ATTEMPT TO DUMP ADT
* 
      LDA DSM8      SET FOR 8 
      STA DSDT0       ADT TRACKS
      LDB DSADT     => DADLC
* 
DSC18 STB DSDT4     => NEXT ADT DESCRIPTER
      LDA DSM3      WRITE IT TO 
      JSB DSMTD       MAG TAPE
      LDA DSDT4     LOAD LENGTH 
      ADA DS.2        OF NEXT 
      LDB 0,I           ADT TRACK 
      ADA DSM2      => DISC ADDRESS 
      JSB DSRWT     ATTEMPT WRITE OF ADT TRACK
      ADB DS.3      ADVANCE TO NEXT ADT DESCRIPTER
      ISZ DSDT0     DONE? 
      JMP DSC18     NO
      SPC 3 
      JMP DSCED     TERMINATE COLD DUMP 
      HED 2000F (OPTION 205) SYSTEM TABLE DUMP UTILITIES
* 
**  ATTEMPT TO WRITE TRACK  **
* 
DSRWT NOP           POINTER TO DISC ADDRESS IN (A)
      STB MWORD     RECORD TRANSFER LENGTH
      SSB,RSS       NEGATIVE? 
      JMP DSRW1     NO, ZERO OR ILLEGAL 
      ADB DSDT1     YES, ADD MAXIMUM VALUE
      SSB           NON-NEGATIVE RESULT?
      JMP DSRW1     NO, TOO LARGE 
      STA DSMTD     YES, SAVE (A) 
      DLD 0,I       DISC
      IOR 1           ADDRESS 
      SZA,RSS           0?
      JMP DSRW1     YES 
      LDA DSMTD     NO, READ
      JSB DSDSD       REQUESTED TRACK 
      RSS           DIDN'T GET IT 
      JSB DSWRT     WRITE TRACK TO TAPE 
DSRW1 JSB DSEDF     WRITE EOF MARK SEQUENCE 
      LDB DSDT4     RETRIEVE DISC ADDRESS POINTER 
      JMP DSRWT,I 
      SPC 3 
* 
**  DISC DRIVER DRIVER  **
* 
DSDSD NOP           POINTER TO DISC ADDRESS IN (A)
      LDB DSBFI     INPUT BUFFER ADDRESS
      JSB DISCA,I   ATTEMPT READ
      JMP DSDS2     BUSY
      JMP DSDS1     BAD ADDRESS, OMIT TRACK 
      LDA MBUSY     WAIT FOR
      SSA             TRANSFER
      JMP *-2           COMPLETION
      SZA,RSS       RETURN TO (P+2) 
      ISZ DSDSD       IF EVERYTHING OK
DSDS1 CLF 0         DISABLE INTERRUPTS
      JMP DSDSD,I 
* 
DSDS2 CLF 0         DISABLE INTERRUPTS
      JMP DSCED     END DUMP
      HED 2000F (OPTION 205) CONSTANTS, TEMPORARIES, ETC. 
DS1MB OCT -1000 
DSM80 DEC -80 
DSM3  DEC -3
DSM2  DEC -2
DSM1  DEC -1
DS.5  DEC 5 
DS.7  DEC 7 
DSB77 OCT 77
DS8K  DEC 8192      MAXIMUM DIRECTORY/IDT TRACK 
DSMSL DEC 10240     MAXIMUM SWAP TRACK LENGTH 
* 
DSADT DEF DADLC 
DSIDT DEF IDEC
DSDTB DEF DKTBL     => DISC LOGICAL UNIT TABLE
DSLLA DEF DSDT2     => FUSS TABLE DISC ADDRESS
DSDIN DEF MDISC     => DISC DRIVER ENTRY POINT
      DEF MDINT     => DISC INTERRUPT PROCESSER 
DSMHA DEF MHTBL     => DISC DRIVER ADDRESS MAP TABLE
DSMFL DEF MFAIL+1 
DSDIR DEF DIREC 
DSDSB JSB DISCB,I   DISC INTERRUPT PROCESS CALL 
DSFBA ABS FBEQT-MLTBL+DSBUF+1  => LOGICAL UNIT TABLE
DSDDA DEF MDISC,I   DISC DRIVER'S CORE ADDRESS
* 
DSBF2 EQU DSBUF+2   LENGTH OF TELETYPE TABLE ENTRY
DSBF7 EQU DSBUF+7   ADDRESS OF SWAP AREA
DSB13 DEF DSBUF+13B    => LINKAGE TABLE DISC ADDRESS
DSB63 EQU DSBUF+63B    DISC DRIVER'S DISC ADDRESS 
* 
DSDT0 EQU 400B
DSDT1 EQU 401B
DSDT2 EQU 402B
DSDT3 EQU 403B
DSDT4 EQU 404B
      HED 2883 DISC BOOT UTILITY ROUTINES 
* 
**  READ FROM LOGICAL DISC 0  **
* 
DSDRD NOP           BLOCK NUMBER IN (B) AND (A) 
      CLE,ELA       CONVERT IT TO 
      ELB             SECTOR NUMBER 
      DIV DS.46     (460) 
      STA DSDT1     SAVE CYLINDER NUMBER
DSDR1 STB DSDT0     SAVE CYLINDER OFFSET
      LSR 16        (B) => (A),  0 => (B) 
      DIV DS.23     COMPUTE 
      ALF,ALF         CYLINDER
      IOR 1             HEAD/SECTOR 
      STA DSDT2           ADDRESS WORD
      LDA DSDT0     COMPUTE 
      CMA,INA         INTRA-CYLINDER
      ADA DS.46         CHUNK SIZE
      LSL 7               IN WORDS
      LDB 0         WILL IT 
      CMA,CLE,INA     SATISFY 
      ADB DSDT3         READ
      SEZ                 REQUEST?
      JMP DSDR2     YES 
* 
      STB DSDT3     NO, SAVE REMAINDER OF REQUEST 
      STA MWORD     NOTE TRANSFER LENGTH
      CMA,INA 
      LDB DSDT4     LOAD BUFFER ADDRESS 
      ADA 1         SAVE INCREMENTED VALUE
      STA DSDT4       FOR FOLLOWING READ
      JSB DSDRC     READ CHUNK
      ISZ DSDT1     ADVANCE TO NEXT CYLINDER
      CLB           FOLLOWING READ
      JMP DSDR1       HAS NO OFFSET 
* 
DSDR2 LDA DSDT3     FINAL 
      STA MWORD       WORD COUNT
      LDB DSDT4     FINAL BUFFER ADDRESS
      JSB DSDRC     COMPLETE READ REQUEST 
      JMP DSDRD,I 
      SKP 
* 
**  INTRA-CYLINDER READ  ** 
* 
DSDRC NOP           BUFFER ADDRESS IN (B) 
      STB DSDT0     SAVE IT 
      LDA DSM8      SET FAILURE 
      STA DSMTD       RETRY COUNTER 
DSDRR LDA DSDT1     LOAD CYLINDER NUMBER
      OTA BSDAT     REQUEST 
      STC BSDAT,C 
      LDA DSSKC       SEEK
      JSB DSDCM 
      JSB DSWTD     WAIT FOR DATA FLAG
      LDA DSDT2     REQUEST 
      OTA BSDAT 
      STC BSDAT,C     HEAD/SECTOR 
      JSB DSWTD     WAIT FOR DATA FLAG
      JSB DSWAT     WAIT FOR SEEK COMPLETION
* 
      LDA DSDC      LINK DMA TO 
      OTA DMAH        DATA CHANNEL
      CLC DMAL      OUTPUT
      LDA DSDT0       CORE
      OTA DMAL          ADDRESS 
      STC DMAL      OUTPUT
      LDA MWORD       TRANSFER
      OTA DMAL          LENGTH
      STC BSDAT,C   ENABLE
      STC DMAH,C      TRANSFER
      LDA DSRED     REQUEST 
      JSB DSDCM       READ
      JSB DSWAT     WAIT FOR TRANSFER COMPLETION
      STF DMAH      TURN OFF DMA
      JMP DSDRC,I 
      SPC 3 
* 
**  ISSUE DISC COMMAND  **
* 
DSDCM NOP           COMMAND IN (A)
      OTA BSCOM 
      CLC BSCOM 
      STC BSCOM,C 
      JMP DSDCM,I 
      SKP 
* 
**  WAIT FOR DATA FLAG  **
* 
DSWTD NOP 
      CLA 
DSWT1 INA,SZA,RSS   WAITED LONG ENOUGH? 
      JMP DSWA2     YES 
      SFS BSDAT     NO, SAMPLE FLAG 
      JMP DSWT1 
      JMP DSWTD,I 
      SPC 3 
* 
**  WAIT FOR COMMAND FLAG  ** 
* 
DSWAT NOP 
      CLA 
DSWA1 LDB DS.4,I    WASTE 
      LDB DS.4,I      TIME
      INA,SZA,RSS   WAITED LONG ENOUGH? 
      JMP DSWA2     YES 
      SFS BSCOM     NO, SAMPLE FLAG 
      JMP DSWA1 
* 
      STC BSDAT,C   REQUEST 
      LDA DSTAT       STATUS OF 
      JSB DSDCM         UNIT 0
      JSB DSWTD     WAIT FOR RESPONSE 
      LIA BSDAT     IGNORE
      AND DS177       UNIT NUMBER 
      SZA,RSS       STATUS OK?
      JMP DSWAT,I   YES 
* 
      AND DS100     NO
      SZA           DRIVE READY?
      HLT 22B       NO, WAIT AWHILE 
DSWA2 CLC 0,C       CLEAR I/O SYSTEM
      ISZ DSMTD     TRIED ENOUGH? 
      RSS           NO
      JMP DSCTM     YES, NO HOPE
* 
      LDA DSRCL     REQUEST 
      JSB DSDCM       RECALIBRATION 
      JSB DSWAT     WAIT FOR COMPLETION 
      JMP DSDRR     RETRY READ
      HED 2883 DISC BOOT CONSTANTS, TEMPORARIES, ETC. 
DS.23 DEC 23        SECTORS / TRACK 
DS.46 DEC 460       SECTORS / CYLINDER
DS100 OCT 100 
DS177 OCT 177 
DSTAT OCT 10000     DISC STATUS COMMAND (UNIT 0)
DSRCL OCT 20000     DISC RECALIBRATE CMND (UNIT 0)
DSSKC OCT 30000     DISC SEEK COMMAND (UNIT 0)
DSRED OCT 40000     DISC READ COMMAND (UNIT 0)
DSDC  ABS 120000B+BSDAT  DISC DMA LINK WORD 
* 
      END 
