.ENABLE GLOBAL
.ENABLE SUBSTITUTION
.ENABLE QUIET
PAGE
.SETS $UIC <UIC>
.SETS $SYDSK <SYDISK>
.SETN $UNIT <SYUNIT>
.SETF ACS
.SETF OK
.SETF INSACS
.SETF INSVFY
.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
.IFF VFY .GOTO OK1A
.IFNINS VFY .SETT INSVFY
.IFT INSVFY INS $VFY/INC=40000
VFY 'DISK':/RC
.IF <EXSTAT> EQ 1 .GOTO OK1
; DISK VERIFICATION ERROR, WE WILL EXIT NOW AND ALLOW YOU TO CHECK
.IFT INSVFY REM VFY
.GOTO EEXIT
.OK1:
.IFT INSVFY REM VFY
TCF 7,7
.OK1A:
.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
.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
.IF DISK EQ DK0 .SETT ACS
.IF DISK EQ DK1 .SETT ACS
.IF DISK EQ DK5 .SETT ACS
.;.OPEN 'DISK':[0,0]DUMMY.TXT;1
.;.DATA ;BLANK LINE
.;.CLOSE
.;PIP 'DISK':[0,0]DUMMY.TXT;1/DE
.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
DMOU 'DISK':'NAME'
.;once DMO is fixed you won't have to ask.  Use <EXSTAT> to test for success
.ASK DSMNT DID THE DISK DISMOUNT 
.IFF DSMNT DEV DK:
.IFF DSMNT .GOTO 10
INS $DSC
DSC MM0:/RW/VE='DISK':
.IF <EXSTAT> NE 1 ; DSC FAILED , EXITING
.IF <EXSTAT> NE 1 .GOTO EEXIT
REM DSC
MOU 'DISK':/OVR/LRU=4.
.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"
.SETS FILNM "DK1:"+NAME+".DSC"
.SETF FILEIS
.IFEXI 'FILNM' .SETT FILEIS
.IFT FILEIS .OPENA 'FILNAM'
.IFF FILEIS .OPEN '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:
