.ENABLE GLOBAL
.ENABLE SUBSTITUTION
.ENABLE QUIET
PAGE
.SETS $UIC <UIC>
.SETS $SYDSK <SYDISK>
.SETN $UNIT <SYUNIT>
.SETF ACS
.SETF OK
.SETF INSACS
.SETF INSVFY
.SETF TAPVFY
.SETS DK0 "DK0"
.SETS DK1 "DK1"
.SETS DK2 "DK2"
.SETS DK3 "DK3"
.SETS DK4 "DK4"
.SETS DK5 "DK5"
.SETS CR ""
.10:.ASKS DSK WHICH DISK DO YOU WISH TO SAVE(DKNN)
.SETS DISK DSK[1:3]
.IF DISK EQ CR .GOTO 100
.IF DISK EQ DK0 .GOTO 15
.ASK VFY CHECK THE DISK FOR PARITY ERRORS
.IF DISK EQ DK1 .GOTO 20
.IF DISK EQ DK2 .GOTO 20
.IF DISK EQ DK3 .GOTO 20
.IF DISK EQ DK4 .GOTO 20
.IF DISK EQ DK5 .GOTO 20
.DISABLE QUIET
; 'DISK' IS NOT DK0-DK5
.ENABLE QUIET
.GOTO 10
.15:;TO SAVE THE SYSTEM DISK TO MAGTAPE ONE MUST USE THE
;DISKSAV.CMD FILE ON DK1:.   NOW CHAIN TO @DK1:DISKSAV
.CHAIN DK1:[1,7]DISKSAV.CMD
.20:
ASN DK0:=SY:
SET /UIC=[1,7]
.ASKS NAME WHAT IS THE DISK NAME
.ASKS TAPE WHAT IS THE NUMBER OF THE MAGTAPE VOLUME
.ASK TAPVFY VFY THE TAPE COPY
.IFF VFY .GOTO NOVFY
.IFNINS VFY .SETT INSVFY
.IFT INSVFY INS $VFY/INC=40000
VFY 'DISK':/RC
.IF <EXSTAT> EQ 1 .GOTO OK1
.DISABLE QUIET
; DISK VERIFICATION ERROR, WE WILL EXIT NOW AND ALLOW YOU TO CHECK
.ENABLE QUIET
.IFT INSVFY REM VFY
.GOTO EEXIT
.OK1:
.IFT INSVFY REM VFY
.NOVFY:
.IFT TAPVFY .SETS $VFY "/VE"
.IFF TAPVFY .SETS $VFY ""
.IF DISK EQ DK0 .SETT ACS
.IF DISK EQ DK1 .SETT ACS
.IF DISK EQ DK5 .SETT ACS
.IFT ACS .IFNINS ACS .SETT INSACS
.IFT ACS .IFNINS ACS INS LB:[1,54]ACS
.IFT ACS ACS 'DISK':/BLKS=0.
.IFT ACS .IFT INSACS REM ACS
.SETT DSMNT
DMOU 'DISK':'NAME'/DEV
.IF <EXSTAT> NE 1 .SETF DSMNT
.IFF DSMNT .DISABLE QUIET
.IFF DSMNT ; WARNING -- DISK DID NOT DISMOUNT
.IFF DSMNT .ENABLE QUIET
.IFF DSMNT  .GOTO 10
INS $DSC
ALL MM0:
DSC MM0:/RW'$VFY'='DISK':
DEA MM0:
.IF <EXSTAT> NE 1 .DISABLE QUIET
.IF <EXSTAT> EQ 2 ; WARNING, DSC HAD PROBLEMS, CLEAN UP DISK
.IF <EXSTAT> EQ 4 ; FATAL DSC ERROR ,  EXITING
.IF <EXSTAT> EQ 4 ; GOTO EEXIT
.ENABLE QUIET
REM DSC
MOU 'DISK':/OVR
.IF <EXSTAT> NE 1 ; DISK WOULD NOT REMOUNT, EXITING
.IF <EXSTAT> NE 1 .GOTO EEXIT
.IFT ACS .IFT INSACS INS LB:[1,54]ACS/INC=0
.IF DISK EQ DK0 ACS 'DISK':/BLKS=200.
.IF DISK EQ DK1 ACS 'DISK':/BLKS=200.
.IF DISK EQ DK5 ACS 'DISK':/BLKS=300.
.IFT ACS .IFT INSACS REM ACS
SET /UIC=[1,7]
.SETS FILNAM "DK1:"+NAME+".DSC"
.OPENA 'FILNAM'
.DATA  'DISK':'NAME'  DSC/SAVED ON MAGTAPE #'TAPE'   '<DATE>' '<TIME>'
.CLOSE
PIP DK1:'NAME'.DSC/TR
REWIND
.100:TCF 7
;THE DISK SAVE IS FINISHED
.EEXIT:
SET /UIC ='$UIC'
ASN '$SYDSK''$UNIT':=SY:
