.MCALL .MODULE .MODULE DIRERR,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. .SBTTL Edit History ;+ ; ; (005) 29-Nov-91 MBG Added error checking for /OUT to volume with ; invalid directory. Modified error message. ; ;- ; ; DIR (Directory Program) ; .NLIST .LIST .PSECT OUTPUT .SBTTL ERROR- Error processor ;+ ; ; ERROR ; This routine handles errors generated by DIR. The call is: ; ; JSR R5,ERROR ; .BYTE error number ; .BYTE error level ; R3 <> 0 -> address of filename to print ; R2 <> 0 -> address of ASCII byte to print ; ; If bit 15 is set, the routine returns to the caller. Otherwise, it jumps ; to the restart address. ; ;- XTERNL GBLDAT ASCB: .ASCII / / ;ASCII blanks COLON: .ASCII /:/ ;ASCII : DOT: .ASCII /./ ;ASCII . ERRFIL: .BLKW 8. ;ASCII error filename TMPFIL: .BLKW 8. ;Temporary ASCII error filename ERROR:: ; CALL CLRBUF ;Dump anything in the output buffer ;CG06 TST NEWLIN ;Were we working on a line? BEQ 10$ ;Branch if not .PRINT #CRLF ;Output a 10$: CLR R1 ; BISB (R5)+,R1 ;Get the error number ASL R1 ;Make it a word offset ADD #ERRMSG,R1 ;Point to the error message MOVB (R5),R0 ;Get error level ;MG01+ BIC #177600,R0 BISB MSKLST(R0),@#S$UERR ;Indicate the error MOVB CHRLST(R0),ELEVEL ;Complete the prefix ;MG01- .PRINT #ERRSTR ;"?DIR-l-" .PRINT @R1 ;Print the message TST R3 ;Filename to print? BEQ 90$ ;If no, branch MOV #8.,R1 ;Clear MOV #ERRFIL,R0 ;filename MOV #TMPFIL,R4 ;areas 20$: MOV ASCB,(R0)+ MOV ASCB,(R4)+ DEC R1 BGT 20$ MOV #ERRFIL,R1 ;Get save area for ASCII MOV (R3)+,R0 ;Get device name CALL $R50ASC ;Convert it to ASCII TST @R3 ;Device name only? BEQ 30$ ;If yes, branch MOV R3,R0 ;Point to the next 3 words CALL RTOA ;Convert them to ASCII 30$: MOV R1,-(SP) ;Save char end address CLR R4 ;Counter MOV #ERRFIL,R1 MOV #TMPFIL,R0 40$: CMPB (R1),#BLANK ;Char a blank? BNE 45$ ;If not, branch TSTB (R1)+ ;Point past blank BR 50$ ; 45$: MOVB (R1)+,(R0)+ ;No, save char INC R4 ;Inc counter CMP R4,#3 ;End of device name? BNE 40$ ;If not, branch 50$: MOVB COLON,(R0)+ ;Put in : TST @R3 ;Device name only? BEQ 80$ ;If yes, branch 60$: CMPB (R1)+,#BLANK ;Skip leading blanks BEQ 60$ TSTB -(R1) ;Point to 1st nonblank char 70$: MOVB (R1)+,(R0)+ ;Move filnam character CMPB @R1,#BLANK ;Is next char a blank? BNE 70$ ;If not, branch MOVB DOT,(R0)+ ;Yes, put in . 75$: CMPB (R1)+,#BLANK ;Skip leading blanks BEQ 75$ CMP R1,@SP ;At end of filname? BGE 80$ ;If yes, branch TSTB -(R1) ;Point to 1st nonblank char MOVB (R1)+,(R0)+ ;Move filtyp MOVB (R1)+,(R0)+ ;into save MOVB (R1)+,(R0)+ ;area 80$: MOVB #200,(R0) ;Put in terminator .PRINT #TMPFIL ;Print filename MOV (SP)+,R1 ;Restore R1 BR 100$ 90$: TST R2 ;Switch error? BEQ 100$ ;If not, branch .PRINT R2 ;Print the switch 100$: CLR R0 ;Terminate .PRINT ;.PRINT TSTB (R5)+ ;Should we return? BMI 1$ ;Branch if so JMP RETRY ;Else restart 1$: RTS R5 ;Return to caller .SBTTL Error message strings .PSECT IMPURE,D .NLIST BEX ERRSTR: .ASCII \?DIR-\ ELEVEL: .ASCII \l-\<200> MSKLST: .BYTE 0,2,4,10,20 ;MG01 CHRLST: .ASCII /IWEFU/ .EVEN .LIST BEX ..MSG. = 0 .MACRO ERMSG NAME,TEXT NAME'... == ..MSG. ..MSG. = ..MSG. +1 .PSECT PURE,D .NLIST BEX NAME: .ASCII \TEXT\ .BYTE 200 .EVEN .LIST BEX .PSECT ERRLST,D .WORD NAME .PSECT OUTPUT .ENDM ERMSG .PSECT ERRLST,D ;+ ;ERROR ERRMSG:: ERMSG ERD, ERMSG WER, ERMSG ILD, ERMSG ILC, ERMSG ILO, ERMSG IDV, ERMSG OPF, ERMSG DNA, ERMSG NOM, ERMSG PFE, ERMSG FCP, ERMSG BKF, ERMSG RER, ERMSG VER, ;- .END