.MCALL .MODULE .MODULE INDERR,VERSION=07,COMMENT= GLOBAL=.IERR ; 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. .ENABL GBL,LC .SBTTL Macros and other definitions ;+ ;System macro calls. ;- .MCALL .TTYOUT, .PRINT, .RCTRLO .MCALL GCLDF$, FERDF$, RT5DF$, DEFIN$ GCLDF$ ;Define GCML offsets. FERDF$ ;Define file error codes. RT5DF$ ;Define RT locations and offsets DEFIN$ ;Definitions for IND files .PSECT INDERR .SBTTL Error messages ;+ ;NOTE******************************* ;The next two error message tables must be kept in order (that is general ;messages first followed by I/O error messages). This is necessary since ;there is a position test in ERR to determine what error has occured. ; ;General error messages. ;- .NLIST BEX EMNOV: .ASCIZ /Numeric under- or overflow/ EMSYN: .ASCIZ /Syntax error/ EMFNF: .ASCIZ /File not found/ EMNPS: .ASCIZ /Error reading from terminal/ EMFRD: .ASCIZ /File read error/ EMRSZ: .ASCIZ /String expression exceeded limit/ EMIDE: .ASCIZ /Maximum indirect files exceeded/ ..INEO:: ; Customization Global EMEOF: .ASCIZ /@ / ; Exit message EMIKW: .ASCIZ /Invalid keyword/ EMSOV: .ASCII /Symbol table overflow / SYMSOV: .BLKB SSIZE+1 EMUDS: .ASCII /Undefined symbol / SYMUDS: .BLKB SSIZE+3 EMUDL: .ASCII /Undefined label ./ SYMUDL: .ASCIZ /Labelx: / EMRES: .ASCIZ /Redefining special symbol/ EMRED: .ASCII /Redefining symbol to different type / SYMRED: .BLKB SSIZE+1 EMDFE: .ASCIZ /Data file error/ EMTYP: .ASCII /Symbol type error / SYMTYP: .BLKB SSIZE+3 EMSUB: .ASCIZ /String substitution error/ EMSBN: .ASCIZ /Subroutine nesting too deep/ EMRET: .ASCIZ /.RETURN without .GOSUB/ EMIFN: .ASCIZ /Invalid file number/ EMFOP: .ASCIZ /File already open/ EMFNO: .ASCIZ /File not open/ EMBRD: .ASCIZ /Bad range or default specification/ EMNST: .ASCIZ /Invalid nesting/ EMNUL: .ASCIZ /Null control string/ EMSPW: .ASCIZ /Swap error/ EMXQT: .ASCIZ /Data file open/ EMLAB: .ASCIZ /Label not at beginning of line/ EMSWT: .ASCIZ /Invalid option/ EMCOM: .ASCIZ /Invalid command/ EMDEV: .ASCIZ /Invalid device or unit/ EMPMT: .ASCIZ /Prompt string too large/ EMAES: .ASCIZ /Invalid attempt to erase symbol/ EMDSP: .ASCIZ /Deleting special symbol/ EMVER: .ASCIZ /Wrong version of RT-11/ EMMIX: .ASCIZ /Invalid operator for operation/ EMATT: .ASCIZ /Device is attached/ ;+ ;I/O error messages. ;- EMEND: .ASCIZ /End of file/ EMIDU: .ASCIZ /Invalid device or unit/ EMNOS: .ASCIZ /No room to FETCH handler/ EMDAO: .ASCIZ /Data overrun/ EMDFU: .ASCIZ /Device full/ EMNSF: .ASCIZ /No such file/ EMWAC: .ASCIZ /File accessed for write/ EMRER: .ASCIZ /Device read error/ EMWER: .ASCIZ /Device write error/ EMNLN: .ASCIZ /No file accessed on channel/ EMNBK: .ASCIZ /File exceeds space allocated/ EMBTP: .ASCIZ /Bad record type - not ASCII data/ EMRAC: .ASCIZ /File accessed for read/ EMPRO: .ASCIZ /File protection error/ EMFAO: .ASCIZ /File already open/ EMBNM: .ASCIZ /Bad file name/ EMUDF: .ASCIZ /Undefined error code/ .EVEN .LIST BEX .SBTTL Error tables ;+ ;*** NOTE*** ;This table must define the errors in order of ascending error codes, as ;defined in module "INDIMP" ;- ERRTB0: ERR NOV,ERR ;Numeric under- or overflow ERR SYN,ERRX ;Syntax error ERR FNF,EPFNF ;"@" file not found ERR NPS,SECOND ;Error reading from terminal ERR FRD,SECOND ;File read error ERR RSZ,ERRX ;String expression exceeds limit ERR IDE,ERRX ;Indirect nesting too deep ERR EOF,EPEOF ;End of file ERR IKW,ERR ;Invalid keyword ERR SOV,EPSOV ;Symbol table overflow ERR UDS,EPUDS ;Undefined symbol ERR UDL,EPUDL ;Undefined label ERR RES,ERRX ;Re-defining special symbol ERR RED,EPRED ;Re-defining symbol to different type ERR DFE,SECOND ;Data file error ERR TYP,EPTYP ;Symbol type error ERR SUB,ERR ;String substitution error ERR SBN,ERR ;Subroutine nesting too deep ERR RET,ERR ;.RETURN without .GOSUB ERR IFN,ERR ;Invalid file number ERR FOP,ERR ;File already open ERR FNO,ERR ;File not open ERR BRD,ERR ;Bad range or default specification ERR NST,ERR ;Block nesting invalid ERR NUL,ERR ;Null control string (to .PARSE) ERR SPW,SECOND ;Swap error ERR XQT,ERR ;Data file open ERR LAB,ERR ;Label not at beginning of line ERR SWT,EPFNF ;Invalid option ERR COM,ERRX ;Invalid command ERR DEV,EPFNF ;Invalid device or unit ERR PMT,ERRX ;Prompt string too large ERR AES,ERR ;Invalid attempt to erase symbol ERR DSP,ERR ;Deleting special symbol ERR VER,ERRX ;Wrong version of RT-11 ERR MIX,ERR ;Mixed operators on logical operation ERR ATT,ERR ;Device is attached ;+ ;I/O error table ;- ERRTB1: .WORD IE.EOF,EMEND ;End of file .WORD IE.IDU,EMIDU ;Invalid device or unit .WORD IE.NOS,EMNOS ;No room to FETCH handler .WORD IE.DAO,EMDAO ;Data overrun .WORD IE.DFU,EMDFU ;Device full .WORD IE.NSF,EMNSF ;No such file .WORD IE.WAC,EMWAC ;File accessed for write .WORD IE.RER,EMRER ;Device read error .WORD IE.WER,EMWER ;Device write error .WORD IE.NLN,EMNLN ;No file accessed on chnnel .WORD IE.NBK,EMNBK ;File exceeds space allocated .WORD IE.BTP,EMBTP ;Bad record type - non-ascii data .WORD IE.RAC,EMRAC ;File accessed for read .WORD IE.PRO,EMPRO ;Protection violation .WORD IE.FOP,EMFAO ;File already open .WORD IE.BNM,EMBNM ;Bad file name ERRTBE: .WORD EMUDF ;Undefine error code ;+ ;Error message prefix. All errors are fatal. Special warning messages. ;- .NLIST BEX PREMSG: .ASCIZ /?IND-F-/<200> ERTIM:: .ASCIZ /?IND-W-Timeout support not available/ INAMSG::.ASCIZ /?IND-E-Invalid answer or terminator/ ISLMSG::.ASCIZ /?IND-E-String length not in range/ IVMSG:: .ASCIZ /?IND-E-Value not in range/ ;+ ;ASCII strings used in displaying symbol table dumps (INDDMP). ;- BNDRY:: .ASCIZ /------------------------------------------------------------------------------/ GLBHDR::.ASCIZ /Global symbols:/ LCLHDR::.ASCIZ /Local symbols:/ SPCHDR::.ASCIZ /Special symbols:/ NOGBL:: .ASCIZ /****There are no global symbols****/ NOLCL:: .ASCIZ /****There are no local symbols****/ .EVEN .LIST BEX .SBTTL INDERR - Indirect error processor ;+ ;INDERR - Errors come here with trap PC+2 on the top of the stack. The ;trap operand equals error code. Additional (error specific) information may ;be in registers R0 - R4 and/or on stack. ;- .ENABL LSB INDERR::.RCTRLO ;Reset CTRL/O SUB #2,@SP ;Point to the address of the trap instruction. CLR R5 ;CLR and BISB to avoid sign extend of MOVB BISB @(SP)+,R5 ;Get error code ASL R5 ;Get error code * 2 ASL R5 ;Get error code * 4 MOV ERRTB0(R5),@SP ;Get address of error message JMP @ERRTB0+2(R5) ;Go process the error .DSABL LSB .SBTTL Special case error messages ;+ ;The following handles special case error messages. For example, the ;message requires the symbol name which must be converted from RAD50 ;to ASCII and then stored in the message itself. ;- .ENABL LSB EPTYP: MOV #SYMTYP,R0 ;Point to area to store symbol (type) name BR SYMNAM ;Convert name to ASCII and store EPSOV: CLR ERLBL ;No error processing MOV #SYMSOV,R0 ;Point to store symbol name causing overflow BR SYMNAM ;Convert name to ASCII and store EPRED: MOV #SYMRED,R0 ;Point to store redefined symbol name BR SYMNAM ;Convert name to ASCII and store EPUDS: MOV #SYMUDS,R0 ;Point to area to store undefined symbol name .BR SYMNAM ;+ ;Converts a symbol name into an ASCII string. Trailing spaces are ;discarded. ;- SYMNAM: TST ERLBL ;ONERR enabled? BNE ERR ;If yes branch to clean stack and goto label TSTB SPCSYM ;Special symbol? BEQ 1$ ;No, don't print open bracket MOVB #'<,(R0)+ ;Yes, first character is open bracket 1$: MOV #CRNTS,R5 ;Point at current symbol name MOV (R5)+,R1 ;Get first RAD50 word of symbol name CALL $C5TA ;Convert it to three ASCII characters MOV @R5,R1 ;Get second RAD50 word of symbol name CALL $C5TA ;Convert it to three ASCII characters 2$: CMPB -(R0),# ;Skip trailing blanks BEQ 2$ ;If space check next character INC R0 ;If not, adjust pointer at end of symbol name TSTB SPCSYM ;Special symbol? BEQ 4$ ;No, don't print close bracket MOVB #'>,(R0)+ ;Yes, last character is close bracket BR 4$ ;End string and go do common EPEOF: RESTOR ;Get the message string CLR ERLBL ;No error processing BR PREXIT ;Print the message and exit routine ;+ ;File not found error message ;- EPFNF: .PRINT #PREMSG ;Print error message prefix CLR ERLBL ;Set so no error processing is allowed MOV #,STATUS ;Indicate error has occurred RESTOR ;Get address of error message .PRINT ;Print it .TTYOUT #HT ;Print tab for sub error message MOV #CMDBUF+1,R0 ;Point to offending command without "@" BR PREXIT ;Print command line and exit EPUDL: TST ERLBL ;ONERR enabled? BNE ERR ;If yes branch to clean stack and goto label MOV #SYMUDL,R1 ;Point to area to store label MOV #LABL,R2 ;Point to current label 3$: MOVB (R2)+,(R1)+ ;Move in text BNE 3$ ;Get next if not equal MOVB #,-1(R1) ;Next character is a colon MOV R1,R0 ;R0 -> to end of string 4$: CLRB @R0 ;Set end of string BR ERRX ;Go print message .DSABL LSB .SBTTL Secondary message processing ;+ ;The following routine is entered if a secondary error message is to be ;printed as an explanation. The secondary error code is taken from F$ERR ;into the FDB. After the message is printed, control goes to ERR2 to print ;the secondary error message. ;- .ENABL LSB SECOND: TST ERLBL ;ONERR enabled? BNE ERR ;If yes branch to clean stack and goto label SAVE .PRINT #PREMSG ;Print error message prefix RESTOR MOV F$ERR(R0),R1 ;Get error code from FDB RESTOR ;Point to message to print .PRINT ;Print it MOV #ERRTB1,R0 ;Point to I/O error table 1$: CMP R1,(R0)+ ;Does error code match table entry? BEQ 2$ ;Yes TST (R0)+ ;No, point to next entry CMP R0,#ERRTBE ;End of table? BLO 1$ ;No 2$: MOV @R0,-(SP) ;Get address of error message BR ERR2 ;Print secondary message .DSABL LSB .SBTTL Common error processing routine. ;+ ;Control comes here after all special handling is complete or if the ;error message does not require special handling. ;- .ENABL LSB ERR: TST ERLBL ;Is error processing enabled? BEQ ERRX ;No, process the error message TST (SP)+ ;Clean stack before exiting BR EXIT ;Exit without printing an error ERRX: CLR ERLBL ;Set so no error processing is allowed SAVE .PRINT #PREMSG ;Print error message prefix RESTOR ERR2: BISB #,@#USERRB ;Set the user error byte to FATAL error MOV #,STATUS ;Indicate error has occurred RESTOR ;Get address of error message .PRINT ;Print it .TTYOUT #HT ;Print tab for sub error message MOV GCML+G.CMLD+2,R0 ;Get command line .PRINT ;Print command line as sub-error 1$: TST SBFLG ;Did substitution occur? BEQ EXIT ;No need to print new line ERRF: .TTYOUT #HT ;Print tab for sub error message MOV #CMDBUF,R0 ;Get command buffer address PREXIT: .PRINT EXIT: JMP ATEX1 .DSABL LSB .END