
      HED UTILITY ROUTINES
* 
*   CHECK FOR VALID FEATURE LEVEL CODE ON SELECTIVE LOAD TAPE 
*      OR DISC LIBRARY. 
*   ON ENTRY: 
*         (A) = FEATURE LEVEL CODE FROM TAPE OR DISC
*         STMP1 = FEATURE LEVEL CODE OF SYSTEM
*         (P+1) = ADDRESS OF "TAPE" OR "DISC" 
*   EXIT TO (P+2) IF INVALID FEATURE LEVEL NOT ACCEPTED BY OPERATOR 
*           (P+3) IF VALID FEATURE LEVEL OR OPERATOR ACCEPTS
*                 RESPONSIBILITY FOR LOADING FROM TAPE
* 
CKFC  NOP           NEW FOR VERSION B            [B]
      LDB A 
      CMB,INB       IS NEW
      ADB STP1A,I     FEATURE LEVEL 
      SSB,RSS           <= SYSTEM'S?
      JMP CKFC3     YES, EXIT TO (P+3)
      STA TLSLQ,I   NO, SAVE IF SYSTEM UPDATE 
      LDB TAPFB     CONVERT NEW FEATURE LEVEL TO
      JSB DACVA,I     ASCII & DEPOSIT IN MESSAGE
      LDA STP1A,I   CONVERT FEATURE LEVEL 
      LDB DSCFB       OF SYSTEM TO ASCII AND
      JSB DACVA,I       DEPOSIT IN MESSAGE
      LDA CKFC,I    SET "TAPE"
      DLD A,I         OR "DISC" 
      DST FLW+1         INTO MESSAGE
      LDA QD106     PRINT 
      LDB FLWA        WARNING 
CKFC1 JSB TT35Q,I   ASK IF RESPONSIBILITY TAKEN 
      CLA           GET 
      JSB TT35Q,I 
      JSB GETCQ,I     ANSWER
      JMP CKFC2     (NO ANSWER, ASK AGAIN)
      CPA .N        'N' ? 
      JMP CKFC4     YES, EXIT TO (P+2)
      CPA .Y        'Y' ? 
      JMP CKFC3     YES, EXIT TO (P+3)
CKFC2 LDA QD30      NO, ILLEGAL RESPONSE
      LDB FLWDA     ASK 
      JMP CKFC1       AGAIN 
* 
CKFC3 ISZ CKFC
CKFC4 ISZ CKFC
      JMP CKFC,I
      SKP 
* 
**  SUBROUTINE TO READ A SEGMENT FROM DISC TO CORE ACCORDING TO SST.
* 
*   ON ENTRY, (A) POINTS TO THE SEGMENT ENTRY IN SST TO BE READ IN
* 
RDSEG NOP 
      LDB A,I       GET LENGTH
      STB MWORD       OF SEGMENT
      INA           => CORE ADDRESS 
      LDB A,I       SET (B) TO INPUT ADDRESS
      ADB B100K     ADD IN INPUT BIT
      INA           => DISC ADDRESS 
      JSB DISCQ,I   READ IN SEGMENT 
      JMP RDSEG,I   RETURN
* 
**  SUBROUTINE TO WRITE A SEGMENT TO DISC ACCORDING TO SST. 
* 
*   ON ENTRY, (A) POINTS TO THE LENGTH WORD OF THE SEGMENT IN SST.
* 
WRSEG NOP 
      LDB A,I       GET LENGTH OF SEGMENT 
      STB MWORD       TO BE WRITTEN 
      INA           => CORE ADDRESS 
      LDB A,I       SET (B) = CORE ADDRESS
      INA           => DISC ADDRESS 
      JSB DISCQ,I   WRITE 
      JMP WRSEG,I   RETURN. 
      HED END OF TAPE ROUTINE 
* 
*      THIS ROUTINE IS CALLED AFTER EACH WRITE TO THE MAG. TAPE 
* TO CHECK FOR THE END OF THE TAPE CONDITION. 
*      IF THE MAG. TAPE DUMP IS CURRENTLY WRITING,
* THE ROUTINE CHECKS FOR THE END OF TAPE STATUS.
* IF IT IS ASSERTED, THE FOLLOWING ACTIONS ARE TAKEN: 
* 
*     1 ) THE RETURN ADDRESS AND THE DTMP VARIABLES 
*          ARE SAVED IN SAVE AREA ONE 
*     2 ) AN END OF TAPE LABEL IS WRITTEN 
*     3 ) A REWIND IS STARTED 
*     4 ) THE "VERIFY?" QUESTION IS ASKED 
*     5 ) IF YES, THE FOLLOWING OCCURS
*         A ) THE DRIVER DRIVERS ARE SET FOR VERIFY 
*         B ) THE LABEL RECORD IS VERIFIED
*         C ) SAVE AREA 2 IS USED TO RESTORE
*             THE RETURN ADDRESS AND DTMP VARIABLES 
*         D ) THE ROUTINE EXITS FOR THE VERIFY PASS 
*     6 ) THE NEXT REEL IS REQUESTED
*     7 ) THE DRIVER DRIVERS ARE SET FOR WRITE
*     8 ) SAVE AREA ONE IS COPIED TO SAVE AREA TWO
*     9 ) SAVE AREA ONE IS USED TO RESTORE THE RETURN 
*         ADDRESS AND DTMP VARIABLES
*     10) THE TAPE LABEL IS WRITTEN 
*     11) THE ROUTINE EXITS TO WRITE THE NEXT REEL
* 
*      IF THE MAG TAPE DUMP IS CURRENTLY VERIFYING, THE 
* RETURN ADDRESS AND DTMP VARIABLES ARE COMPARED TO 
* SAVE AREA ONE.  IF THE AREAS ARE EQUAL, THE 
* FOLLOWING ACTIONS ARE TAKEN:
*     12) THE END OF TAPE TRAILER IS VERIFIED 
*     13) GO TO STEP 6
* 
*      NOTE THAT SAVE AREA TWO IS THE BEGINNING OF
* REEL DATA, WHILE SAVE AREA ONE IS THE END OF REEL DATA
* 
DTMP0 BSS 1 
DTMP1 BSS 1 
DTMP2 BSS 1 
DTMP3 BSS 1 
DTMP4 BSS 1 
TENCH NOP 
DTMPL EQU *         END OF SAVED AREA 
      LDA MTVFL     GET WRITE/VERIFY FLAG 
      SZA           SKIP ON VERIFY
      JMP TENW      WRITE, CHECK FOR EOT
* 
      LDA DTMPC     SET SAVE AREA 
      STA QTMP0       SIZE COUNTER
      LDA DTMPP     => CURRENT AREA 
      STA QTMP1 
      LDB QTSV1     => SAVE AREA ONE
TENVA EQU * 
      LDA QTMP1,I   GET THE CURRENT WORD
      CPA B,I         AND COMPARE IT TO THE SAVED ONE 
      INB,RSS 
      JMP TENCH,I   A DIFFERENCE, FLAKE OUT 
      ISZ QTMP1 
      ISZ QTMP0     CHECK THE COUNT 
      JMP TENVA 
* 
*     CHECK THE END OF TAPE LABEL 
* 
      JSB MTWF      CHECK FILE MARK 
      LDA TLENG     = LABEL LENGTH
      LDB TLABQ     => LABEL
      JSB MTWR      VERIFY TAPE TRAILER 
      JSB MTWF      AND CHECK SECOND FILE MARK
      JMP MTDMV     GO FOR NEXT REEL
* 
*      A WRITE OPERATION IS IN PROGRESS.  CHECK FOR 
* THE END OF TAPE STATUS
* 
TENW  EQU * 
      LDA QEOTF,I   GET END OF TAPE STATUS BIT
      SZA,RSS       SKIP ON END OF TAPE STATUS
      JMP TENCH,I   NOT END OF TAPE, FLAKE OUT
      LDA DTMPC     SET SAVE AREA 
      STA QTMP0       SIZE COUNTER
      LDA DTMPP     => CURRENT AREA 
      STA QTMP1 
      LDB QTSV1     => SAVE AREA ONE
TENWB EQU * 
      LDA QTMP1,I   COPY CURRENT STATUS 
      STA B,I         TO SAVE AREA ONE
      INB           ADVANCE 
      ISZ QTMP1       POINTERS
      ISZ QTMP0         AND COUNT 
      JMP TENWB 
* 
*     WRITE THE END OF TAPE TRAILER 
* 
      JSB MTWF      FIRST WRITE A FILE MARK 
      LDA TLENG     = LABEL LENGTH
      LDB TLABQ     => LABEL AREA 
      JSB MTWR
      JSB MTWF      AND A FINAL TAPE MARK 
* 
      JSB MTP,I     REWIND
      OCT 3 
MTESQ EQU * 
      LDA QD9 
      LDB VRFYA     PRINT "VERIFY"
      JSB TT35Q,I     QUESTION
      CLA 
      JSB TT35Q,I   CALL FOR INPUT
      JSB MGTCA,I   GET THE FIRST CHARACTER 
      JMP MTENR     EMPTY LINE IS ERROR 
      CPA .Y        OPERATOR TYPE "YES"?
      JMP MTGVT     YES, GO VERIFY TAPE 
      CPA .N        OPERATOR TYPE "NO"? 
      JMP MTDMV     MUST NOT DESIRE VERIFY
MTENR EQU * 
      LDA DB17
      LDB ILINM     "ILLEGAL INPUT" 
      JSB TT35Q,I   COMPLAIN ABOUT QUALITY OF 
      JMP MTESQ     ANSWER. 
MTGVT EQU * 
      CLA           SET FLAG
      STA MTVFL       FOR VERIFY
* 
*     VERIFY TAPE LABEL 
* 
TENBR EQU *         SPECIAL ENTRY TO REWRITE A BAD REEL 
TERWD EQU * 
      JSB MTP,I     REWIND
      OCT 3 
      JSB MTP,I     GET STATUS
      OCT 7 
      RRL 9         SOT BIT TO SIGN 
      SSB,RSS       START OF TAPE 
      JMP TERWD     NO, TRY AGAIN 
      LDA TLENG     = LABEL LENGTH
      LDB TLABQ     => LABEL
      JSB MTWR
* 
*      RESTORE FROM SAVE AREA TWO AND EXIT
* FOR EITHER A VERIFY PASS OR A REWRITE OF A BAD TAPE 
* 
      LDA DTMPC     SET SAVE AREA 
      STA QTMP0       SIZE COUNTER
      LDA DTMPP     => CURRENT AREA 
      STA QTMP1 
      LDB QTSV2     => SAVE AREA TWO
TENWE EQU * 
      LDA B,I 
      STA QTMP1,I 
      INB           ADVANCE 
      ISZ QTMP1       POINTERS
      ISZ QTMP0         AND COUNTER 
      JMP TENWE 
* 
      JMP TENCH,I   EXIT TO VERIFY
* 
MTDMV EQU * 
      JSB MTP,I     REWIND AND
      OCT 5           STANDBY 
* 
* 
      LDA LEOS      CHECK FOR END OF SET
      SZA           SKIP IF NOT 
      JMP TENCH,I   EXIT IF DONE
      LDA TLABL+TLRN  ADVANCE REEL
      INA 
      STA TLABL+TLRN    NUMBER
      CLB 
      DIV D.10      FOR TWO DIGIT NUMBER
      ALF,ALF       FIRST DIGIT TO LEFT 
      IOR B 
      IOR QSCZZ     MAKE ASCII DIGITS 
      STA QERLN,I   SET INTO REQUEST
* 
*      PRINT "MOUNT REEL NUMBER XX.  PRESS RUN" 
* 
      LDA QD35      CHARACTER COUNT 
      LDB QNXRN     => MESSAGE
      JSB TT35Q,I 
      HLT 77B       WAIT FOR OPERATOR 
* 
TENWS EQU *         SPECIAL ENTRY 
      CLA,INA       SET FLAG
      STA MTVFL       FOR WRITE 
      LDA DTMPC     SET SAVE AREA 
      STA QTMP0       SIZE COUNTER
      LDA DTMPP     => CURRENT AREA 
      STA QTMP1 
      LDA QTSV2     => SAVE AREA TWO
      STA QTMP2 
      LDB QTSV1     => SAVE AREA ONE
TENWG EQU * 
      LDA B,I       COPY SAVE AREA ONE TO 
      STA QTMP2,I     SAVE AREA TWO AND TO
      STA QTMP1,I       THE CURRENT AREA
      INB           ADVANCE 
      ISZ QTMP2       ALL OF THE
      ISZ QTMP1         POINTERS AND
      ISZ QTMP0           THE COUNTER 
      JMP TENWG 
* 
      JSB MTP,I     REWIND TAPE 
      OCT 3 
* 
*     WRITE THE TAPE LABEL
* 
      LDA TLENG     = LABEL LENGTH
      LDB TLABQ     => LABEL AREA 
      JSB MTWR
      JMP TENCH,I   EXIT
      HED IDT AND DIR DUMP
*      THE ID TABLE OR THE DIRECTORY ARE DUMPED ONTO
* MAG TAPE IN 1024 WORD BLOCKS. 
* 
*     ON ENTRY, (A) => FIRST LENGTH WORD IN THE TABLE 
*               (B) => LAST LENGTH WORD + INCR
*               INCR = LENGTH OF EACH ENTRY IN THE TABLE
*               FDAD => FIRST DISC ADDRESS IN THE TABLE 
* 
CMIDR NOP 
      STA QTMP2     SET TABLE START LOCATION
      STB QTMP3     SET TABLE END LOCATION
      CLA 
      STA QTMP0     SET AMOUNT IN CORE
      LDA ADTBQ     => FIRST 8K BUFFER
      STA QTMP1     SET STARTING AREA POINTER 
MTIWA EQU * 
      LDA QTMP0     GET AMOUNT IN CORE
      ADA QD1K      CHECK TO SEE IF 1024 WORDS IN CORE
      SZA           OKAY IF EXACTLY 1024
      SSA             OR MORE 
      JMP MTIWD     ENOUGH IN CORE, WRITE OUT A PIECE 
* 
*     NOT ENUF IN CORE, READ IN NEXT TRACK
* 
      LDA QTMP1     GET STARTING ADDRESS
      STA MOVES     FOR MOVE SOURCE 
      CPA ADTBQ     DON'T MOVE DATA IF NOT
      JMP MTIWB       REQUIRED
      LDA ADTBQ     AND SET DESTINATION 
      STA QTMP1       SET NEW STARTING ADDRESS
      STA MOVED 
      LDB QTMP0     GET THE WORD COUNT
      JSB MOVEW 
* 
MTIWB EQU * 
      LDA QTMP2     => LENGTH WORD
      CPA QTMP3     CHECK FOR ALL DONE
      JMP MTIWL 
      LDB A,I       GET THE LENGTH
      STB MWORD     SET DISC TRANSFER LENGTH
      SZB,RSS       SKIP IF NON-ZERO TRANSFER 
      JMP MTIWC 
      LDA FDAD      => DISC ADDRESS 
      LDB QTMP0     GET LENGTH IN 
      CMB,INB         POSITIVE FORM TO ADVANCE
      ADB QTMP1         THE STARTING ADDRESS
      ADB B100K     PUT IN INPUT BIT
      JSB DISCQ,I 
      LDB QTMP0     INCREASE AMOUNT IN
      ADB MWORD       CORE
      STB QTMP0 
MTIWC EQU * 
      LDA FDAD      BUMP POINTERS 
      ADA INCR        TO
      STA FDAD          NEXT DISC ADDRESS 
      LDA QTMP2 
      ADA INCR            AND LENGTH WORD 
      STA QTMP2 
      JMP MTIWA 
* 
*     WRITE OUT THE NEXT 1024 WORD BLOCK
* 
MTIWD EQU * 
      LDA QM1K      = WORD COUNT
      LDB QTMP1     SET STARTING ADDRESS
      JSB MTWR      WRITE RECORD ON 
      JSB EOTCH     CHECK FOR END OF TAPE 
      LDA QTMP1     ADVANCE 
      ADA QD1K        THE FIRST 
      STA QTMP1         ADDRESS 
      LDA QTMP0     DECREASE
      ADA QD1K        THE COUNT OF WORDS
      STA QTMP0         IN CORE 
      JMP MTIWA 
* 
*     TAKE CARE OF THE LAST RECORD
* 
MTIWL EQU * 
      LDA QTMP0     CHECK FOR PARTIAL RECORD
      SZA,RSS       SKIP IF SOME LEFT 
      JMP CMIDR,I   EXIT IF NOTHING REMAINS 
      ADA QD11
      SSA           SKIP IF RECORD TOO SHORT
      JMP MTIWP     > 12 IS OKAY
      CMA           FIND HOW MANY MUST BE ZEROED [B]
      STA QTMP3 
      LDA QTMP0     GET RECORD SIZE 
      CMA,INA         IN POSITIVE FORM
      ADA QTMP1     AND ADD TO STARTING ADDRESS 
      CLB 
MTIWN EQU * 
      STB A,I       ZERO OUT THE EXTRA WORDS
      INA 
      ISZ QTMP3 
      JMP MTIWN 
      LDA QM12      USE TWELVE FOR WORD COUNT 
      RSS 
MTIWP LDA QTMP0     USE REAL WORD COUNT IF > 12 
      LDB QTMP1     LOAD STARTING ADDRESS 
      JSB MTWR      AND WRITE RECORD OUT
      JSB EOTCH     CHECK FOR END OF TAPE 
      JMP CMIDR,I   EXIT ROUTINE
      HED UTILITY ROUTINES
* 
*      ROUTINE TO LOAD THE REMAINING FILE LENGTH
* FROM DTMP4 AND CALCULATE THE SIZE OF THE NEXT READ
* 
MTKBL NOP 
      LDA DTMP4     GET THE LENGTH
      LDB A 
      SSA           SKIP IF BLOCK COUNT 
      JMP MTKBN 
      ADA QM4       DECREASE COUNT
      SSA,RSS       SKIP IF TOO CLOSE TO END
      JMP MTKBP     READ FULL SIZE RECORD 
      BLF,BLF       * 256 
      CMB,INB       WORD COUNT IS NEGATIVE
      JMP MTKBQ 
MTKBN EQU * 
      ADA QD1K      DECREASE SIZE 
      SZA           SKIP IF EXACTLY 1024
      SSA           SKIP IF TOO SHORT 
      JMP MTKBP 
      LDA B 
      ADA QD12      CHECK FOR RECORD TOO SHORT
      SSA,RSS       SKIP IF LONGER THAN TWELVE
      LDB QM12
      JMP MTKBQ 
MTKBP LDB QM1K      FULL SIZE RECORD
MTKBQ STB MWORD     SET DISC TRANSFER LENGTH
      JMP MTKBL,I   RETURN
* 
*      ROUTINE TO ENSURE THAT THE CORRECT DIRECTORY 
* TRACK IS IN THE IDT BUFFER
* 
QDIRD NOP 
      CPA QDIPT     CORRECT TRACK IN CORE 
      JMP QDIRD,I   YES 
      STA QDIPT     NO, READ IN 
      LDB A,I       GET LENGTH
      STB MWORD 
      ADA QD5       => DISC ADDRESS 
      LDB IDTBR       AND CORE ADDRESS
      JSB DISCQ,I 
      JMP QDIRD,I   RETURN
QDIPT BSS 1 
* 
*      ROUTINE CALLED WHEN AN END OF TAPE CONDITION 
* IS NOT ALLOWED  ( DURING DUMPING OF SYSTEM TABLES.
* ABOUT 200 FEET OF GOOD TAPE ARE REQUIRED ON THE FIRST REEL )
* 
EOTCH NOP 
      LDA QEOTF,I   GET THE END OF TAPE STATUS BIT
      SZA,RSS       SKIP IF END OF TAPE 
      JMP EOTCH,I   OKAY
      LDA QD22      CHARACTER COUNT FOR MESSAGE 
      LDB QTTSM     "FIRST TAPE TOO SHORT"
      JSB TT35Q,I 
      HLT 11B       WAIT FOR RETRY
      JMP MTDM1 
* 
*     MOVE -B WORDS FROM MOVES,I TO MOVED,I 
* 
MOVEW NOP 
      SSB,INB,RSS   NO SKIP WHEN DONE 
      JMP MOVEW,I   RETURN
      LDA MOVES,I   GET A WORD
      STA MOVED,I   STORE IT
      ISZ MOVES     ADVANCE 
      ISZ MOVED       POINTERS
      JMP MOVEW+1 
MOVES BSS 1 
MOVED BSS 1 
* 
* 
      SPC 4 
*                              *
**  RETURN SWAP AREAS TO ADT  **
*                              *
RTSWP NOP 
      LDA QM128     READ IN 
      STA MWORD       IN
      LDA MLTLE         SWAP
      LDB TRKTD           AREA
      ADB B100K             DISC ADDRESS
      JSB DISCQ,I             TABLE INTO TRKTB
* 
      LDA QM32      SET COUNTER TO
      STA QTMP0       A MAXIMUM OF 32 SWAP AREAS
      LDA TRKTD     => 1ST ENTRY
      STA QTMP1       IN TRKTB
RTSW1 DLD QTMP1,I   DOUBLE WORD 
      IOR B           DISC ADDRESS
      SZA,RSS           = 0?
      JMP RTSW2     YES, NOTHING TO RETURN. NEXT ONE
      LDB QTMP1     NO, RETURN
      LDA QD40        40 BLOCKS 
      JSB RTADB,I       TO ADT
RTSW2 CLA           RESET 
      STA QTMP1,I     ENTRY 
      ISZ QTMP1         TO
      STA QTMP1,I         ZERO
      ISZ QTMP1     BUMP POINTER
      LDA QM128 
      STA MWORD       WRITE BACK
      LDA MLTLE         UPDATED TABLE 
      LDB TRKTD           TO REFLECT
      JSB DISCQ,I           ADT 
      ISZ QTMP0     ALL SWAP AREAS RETURNED?
      JMP RTSW1     NO - NEXT ONE 
      JMP RTSWP,I   RETURN. 
      HED CONSTANTS, TEMPORARIES, ETC.
.N    OCT 116 
.Y    OCT 131 
QM1K  DEC -1024 
QM512 DEC -512
QM128 DEC -128
QM32  DEC -32 
QM12  DEC -12 
QM10  DEC -10 
QM5   DEC -5
QM4   DEC -4
QD2   DEC 2 
QD4   DEC 4 
QD5   DEC 5 
QD7   DEC 7 
QD8   DEC 8 
QD9   DEC 9 
D.10  DEC 10
QD11  DEC 11
QD12  DEC 12
DB17  OCT 17
QD22  DEC 22
QD24  DEC 24
QD30  DEC 30
QD32  DEC 32
QD35  DEC 35
QD40  DEC 40
QD106 DEC 106 
QD1K  DEC 1024
B100K OCT 100000
* 
* 
ADQ6  DEF ADTBL+6   => LAST CHANGE DATE 
ADQ10 DEF ADTBL+10  => FLAG WORD
ADQ11 DEF ADTBL+11  => LENGTH WORD
ADQ12 DEF ADTBL+12,I  PROPER APPEND ADDRESS 
ADTBQ DEF ADTBL     ADT BUFFER POINTER
ADTBR DEF ADTBL,I   READ FORM 
BSDAE DEF BSDA      => SST DISC ADDRESS 
CFFWQ DEF CFFW
DDIRA DEF EQTB      => EQT POINTER
DEM1A DEF DEM1                                   [B]
DEM2A DEF DEM2
DEM3A DEF DEM3                                   [B]
* 
      SUP 
DEM1  OCT 6412                                   [B]
      ASC 11,TOO MANY DISC ERRORS,
DEM2  OCT 6412                                   [B]
      ASC 6,DISC ERROR, 
DEM3  BSS 6         <ID> <NAME>                  [B]
      ASC 3, LOST 
      UNS 
* 
DICLN ABS DIREC-DIREU 
DICPT DEF DIREC 
DIRUQ DEF DIREU     => END OF DIRECTORY 
DISCQ DEF DISCZ 
DSCFB DEF FLWF+1
DACVA DEF DACV
DSERA DEF DSERF 
DT2P  DEF DTMP2 
DTMPC ABS DTMP0-DTMPL LENGTH OF THE SAVE AREAS
DTMPP DEF DTMP0     => CURRENT AREA 
DTRKB DEF IDTBL     DUMP TRACK BUFFER ADDRESS 
DTRKR ABS IDTBL+100000B  DISC READ FORM OF DTRKB
EFIDQ DEF EFID      => ROUTINE TO SEE IF ID IN TABLE
EQTLM ABS EQTB-EQTND  LENGTH OF EQUIPMENT TABLE 
ERRID DEF ERRIN 
FLWA  DEF FLW 
FLWDA DEF FLWD
GETCQ DEF GETCR 
GMQBQ DEF GMQBD     => MESSAGE BUFFER GETTER
GMTSB DEF GMTS
IDEC1 DEF IDEC+1
IDECL DEF IDEC+15   => LAST LENGTH WORD IN IDEC + 4 
IDTBQ DEF IDTBL     BUFFER POINTER
IDTBR DEF IDTBL,I   READ FORM 
ILSID DEF ILSI
JDSEQ DEF JDSE
LBLBI DEF LBLBF,I 
MGTCA DEF GETCR 
MLTBA DEF MLTBL     SYSTEM SEGMENT TABLE ADDRESS
MLTLE DEF MLTLC+2   => DISC ADDRESS OF TRKTB
MTBLN ABS MLTBL-MLTBE    SYSTEM SEGMENT TABLE LENGTH
MTDIP DEF MTDIN     => MAG TAPE CONFIGURATOR
MTP   DEF MTD       => MAG TAPE DRIVER
QDME2 DEF MLTBE+2   => DISC ADDRESS OF EQT
QDMF2 DEF MLTBF+2   => DISC ADDRESS OF DIREC
QEOTF DEF EOTF
QERLN DEF ERLN
QNXRN DEF NXRN      "MOUNT REEL NUMBER XX.  PRESS RUN"
QSCZZ ASC 1,00
QTSV1 DEF TSV1      => SAVE AREA ONE
QTSV2 DEF TSV2      => SAVE AREA TWO
QTTSM DEF TTSM      "FIRST TAPE TOO SHORT"
RLDDQ DEF RLDD
RTADB DEF RTADT 
SLDER DEF DISCY 
SSTLD DEF MLTBL,I 
SSTLM ABS MLTBL-MLTBN 
STP1A DEF STMP1 
SVIDA DEF INBUF+32  HANDY BUFFER                 [B]
SYSCQ DEF SYSCD     => SYSTEM LEVEL CODE         [B]
TLABQ DEF TLABL     => TAPE LABEL 
TLENG ABS -TLEN     NEGATIVE LENGTH OF TAPE LABEL 
TAPFB DEF FLWF+6
TLSLQ DEF TLRT+TLSL+1    => SYSTEM FEATURE CODE  [B]
TRKTD DEF TRKTB 
TS0A  DEF TS0 
TS0   OCT 0,0       TRACK 0, SECTOR 0 
TT35Q DEF TTY35 
DONEA DEF DONEM 
ILINM DEF ILIN
TAPMA DEF TAPMS 
VRFYA DEF VRFY
VTBLA BSS 1         POINTER TO VERIFY BUFFER
VTBL1 DEF 54000B                                 [B]
VTBL2 DEF 44000B
* 
DSECT BSS 1         DISC ERROR COUNTER
FDAD  BSS 1 
INCR  BSS 1 
QTMP0 BSS 1 
QTMP1 BSS 1 
QTMP2 BSS 1 
QTMP3 BSS 1 
LEOS  BSS 1 
MTEMP BSS 2 
RSLFL BSS 1         FLAG FOR MAG TAPE DUMP
*                                   SLEEP = 0 
*                                   HIBERNATE = -1
*                                   RESUSITATION = +1 
SDFLG BSS 1         ZERO SEZ NORMAL SLEEP OR HIB
*                                   NON-ZERO SEZ SELECTIVE DUMP 
TSV1  BSS DTMPL-DTMP0  SAVE AREA ONE
TSV1R EQU *-1 
TSV2  BSS DTMPL-DTMP0  SAVE AREA TWO
* 
TLABL EQU *         TAPE LABEL BUILD AREA 
      ASC 1,LB
      ASC 1,TSB 
      BSS TLEN-2
      SPC 3 
* 
*  CHECK FOR PAGE OVERFLOW
* 
      LDA 20000B                                 [B]
