.MCALL .MODULE .MODULE DUPUNI,VERSION=05,COMMENT=,IDENT=NO ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. ; Edit History: ; ; 001 28-Jan-80 10:47 Guldenschuh, Chuck cpg [240,148] ; Correct "Volume not RT-11 format" problem ; (001) ; 005 06-Nov-1990 JFW ; bracket error messages with ;+/;ERROR/.../;- .ENABL LC,GBL .SBTTL PSECT definitions .IIF NDF MDUP, MDUP = 0 ;Default to no MDUP .IIF NDF M$UPD, M$UPD = 0 ;Default to no MDUP Update .IIF NDF SDC, SDC = 0 ;Default to no SDCOPY PSECT ...ERS ; ;001 PSECT IMPURE ;Impure data ;**-1 PSECT IMPURO ;001 PSECT .LIBD. ;Library data (error messages) ;**-1 PSECT .LIBP. ;Library pointers (error messages) PSECT UNINIT ;Code psect PSECT PATCH ;Patch psect .BLKW 32. .SBTTL Error Messages .MACRO ERRMSG NAME,TEXT DS NAME,BYTE .PSECT .LIBD. EM.'NAME: .ASCII \TEXT\<200> .PSECT .LIBP. .WORD EM.'NAME .ENDM ERRMSG .MACRO MSGLST NAME .DSECT ...ERS,GLOBAL=NO .PSECT .LIBP. NAME: .WORD ..MAX. .ENDM MSGLST .MACRO MSGEND DS ..MAX.,BYTE .ENDM MSGEND ;+ ;ERROR MSGLST OERTAB ERRMSG IRD, ERRMSG UIV, ERRMSG VNR, MSGEND ;- .SBTTL Impure data PSECT IMPURO ;Error message area block OEAREA::.BYTE 0 ; Error code byte .BYTE 0 ; Error level/return flag .WORD ERRPRE ; -> Error message prefix .WORD ERRLEV ; -> Error level byte .WORD OERTAB ; -> Error message offset table .WORD 0 ; -> File name block .WORD ABORT ; -> Abort return .SBTTL UNINIT - Uninitialize a disk ;+ ; UNINIT ;- ORIGIN UNINIT UNINIT:: CALL FGCHEK ;See if foreground is around BEQ 1$ ;Branch if go JMP 16$ ;Get out 1$: .GTCOR # ;Get room for the homeblock and directory BCC 3$ ;Branch if no error ;+ ;ERROR MOV #FE.NOM,R0 ;Set the error code CLR R2 ;Clear the filename 2$: MOV R0,R1 ;Copy the error code .ERR #ERAREA,R1,LEVEL=FATAL,RETURN=NO,FILE=R2 ; <-F-Insuffient memory> ;- 3$: MOV R0,IBFBEG ;Save the pointer to the home block buffer MOV R0,R5 ;Copy the pointer ADD #SEGSIZ,R0 ;R0 -> directory buffer MOV R0,$DIRBF ;Save the pointer to the directory buffer WAIT #WAITIN,#INFILE ;Wait for the input volume to be mounted MOV #ICHAN,$DIRCH ;Set up the directory channel MOV #1,$NXTSG ;Initialize directory scan CLR $NXTFL ;No next file READ #IOAREA,#ICHAN,IBFBEG,#256.,#HOMBLK ;Read in homeblock BCC 5$ ;Branch if no error ;+ ;ERROR MOV #FE.INE,R0 ;Set the error code 4$: MOV #INFILE,R2 ;Set up the filename BR 2$ ;Go give the error ; <-F-Input error dev:> ;- 5$: CMP #<^RV3A>,DK.VRN(R5) ;Is it a V3 directory? BEQ 8$ ;Branch if so CMP #<^RV4A>,DK.VRN(R5) ;How about V4? BEQ 8$ ;Branch if so CMP #<^RV05>,DK.VRN(R5) ;Or V5? BEQ 8$ ;Branch if so ;+ ;ERROR 6$: MOV #VNR,R1 ;Can't restore it 7$: .ERR #OEAREA,R1,LEVEL=FATAL,RETURN=NO,FILE=#INFILE ; <-F-Volume not RT-11 format dev:> ; <-F-Uninitialized volume dev:> ; <-F-Invalid restore data dev:> ;- 8$: MOV R5,R4 ;R4 -> homeblock buffer ADD #DK.SAV,R4 ;R4 -> save data CMP @R4,#MAXSEG ;Is this really the data? Check available segs BHI 9$ ;Branch if not TST @R4 ;Check other end BGT 10$ ;Branch if ok ;+ ;ERROR 9$: MOV #IRD,R1 ;Data no good BR 7$ ;Give error ; <-F-Invalid restore data dev:> ;- 10$: CMP DH.NXT(R4),#MAXSEG ;Check next available seg BHI 9$ ;Branch if no good TST DH.NXT(R4) ;Check other end BMI 9$ ;Branch if no good CMP DH.HI(R4),#MAXSEG ;Check highest open BHI 9$ ;No go TST DH.HI(R4) ;Check lo end BLE 9$ ;Nope ;+ ;ERROR CALL NEXTFL ;Get the 1st directory segment in BCC 11$ ;Branch if no error CMP R0,#FE.ILD ;Invalid directory? BEQ 6$ ;Branch if so BR 2$ ;Go print it ;- 11$: MOV $DIRBF,R5 ;R5 -> directory buffer TST DH.NXT(R5) ;Is the next segment 0? BEQ 13$ ;Branch if so ;+ ;ERROR 12$: MOV #UIV,R1 ;Can't restore uninitialize volumes BR 7$ ;Go give error ; <-F-Uninitialized volume dev:> ;- 13$: CMP $DIRSG,#6 ;Is this the first segment? BNE 12$ ;Branch if not CMP DH.EXB(R5),DH.EXB(R4) ;Number of extra bytes ok? BHI 9$ ;Branch if not MOV R5,R0 ;R0 -> directory buffer ADD #DH.SIZ,R0 ;R0 -> first entry BIT #DS.EMP,@R0 ;First entry empty? BEQ 12$ ;Branch if not ADD #DE.SIZ,R0 ;R0 -> second entry ADD DH.EXB(R5),R0 ;Dont forget extra bytes BIT #DS.EOS,@R0 ;Is it the end-of-segment? BEQ 12$ ;Branch if not. Can't do it MOV R4,R0 ;R0 -> save data. MOV R5,R2 ;R2 -> directory buffer MOV #,R1 ;R1 = number of words to copy 14$: MOV (R0)+,(R2)+ ;Move in directory save data SOB R1,14$ ;Loop ADD DH.EXB(R5),R2 ;Add in extra bytes MOV #,R1 ;Get # words to move 15$: MOV (R0)+,(R2)+ ;Move in second entry SOB R1,15$ ;Loop CALL WRTDIR ;Write out the segment BCC 16$ ;Branch if no error ;+ ;ERROR MOV #DOE,R0 ;Set the error code BR 4$ ; ; <-F-Directory output error dev:> ;- 16$: RETURN .END