.TITLE Error Analyzer. ; Author: T. R. Wyant ; Date: Unknown (1984 sometime) ; Modified: ; Remarks: ; This module contains two error message analyzers ; and formatters, invoked as follows: ; ; INTEGER*2 ERRORF ! Size of error message. ; ; CALL ERRORS(LUN,USRTXT,USRPRM,ERS,...) ; ISIZ = ERRORF(IBUF,USRTXT,USRPRM,ERS,...) ; ; ERRORS actually formats and writes an error message ; on the LUN specified. ERRORF formats the error ; message in buffer IBUF, and returns the size as ; the value of the function. ; ; The arguments are: ; ; LUN - The LUN to write the error message on. ; IBUF - The buffer to build the error message in. ; USRTXT - Optional user text. It consists of optional ; control text, a carriage control byte, ; and a control string suitable for ; $EDMSG. The following characters will ; perform control functions if they appear ; at the start of the text string: ; % - Omit task name and time stamp; ; . - Omit period at end of message; ; P - Use next character for end-of-mes- ; sage punctuation; ; The first character not in the above set ; is taken as carriage control. In ad- ; dition to the usual "+", " ", "0", "1", ; and "$", you can use "@" to specify no ; carriage control whatsoever. ; USRPRM - Optional data to go woth USRTXT. See the ; SYSLIB subroutines manual for what goes ; here. ; ERS - One or more parameters describing the error. ; The first parameter is a RAD-50 string ; describing the type of error. The rest ; depend on the first as follows: ; ; First Next ; ----- -------------------------------- ; DSW Directive status word. ; FCS Synonym for IO. ; FIL Synonym for RMS if RMS support ; was selected - else synonym ; for IO. ; IO I/O status block (2 word array). ; NET Status block from high-level ; language DECnet call. ; NFA Status block from high-level ; language remote file access. ; RMS STS code from RMS. STV (if any) ; is passed in next argument. ; ; The output message looks like: ; ; Taskname - Date - User Message ; Error Type ; Error Detail ; More detail (if appropriate). .ENABL LC .MCALL GTIM$S,GTSK$S,QIOW$S ;;; NETWRK = 0 ; Define to get network messages. ;;; NFAMSG = 0 ; Define to get Network File Access errors. ;;; NETMSG = 0 ; Define to get high-level DECnet errors. ;;; RMSMSG = 0 ; Define to get RMS errors. .IIF DF NFAMSG, NETWRK = 0 .IIF DF NETMSG, NETWRK = 0 .IF DF NETWRK .LIBRARY /LB:[1,1]NETLIB/ .MCALL NSSYM$ NSSYM$ .ENDC ; DF NETWRK .IF DF RMSMSG .LIBRARY /LB:[1,1]RMSMAC/ .MCALL $RMSTAT $RMSTAT DFIN$L .ENDC ; DF RMSMSG .MACRO ERRLST NAME,OPT,TEXT,FMT=D,SYN ERRFLG = 0 ERRSYM =: 1 ; Include symbolic with error message (1=yes). ERRCUR =: 2 ; Continue analyzing current error (1=yes). ERRBYT =: 4 ; Byte argument (1=yes). ERRALN =: 10 ; Perform alignment (1=yes). ERRODD =: 20 ; Align on odd boundary (1=yes). ERRSYN =: 40 ; Synonym entry (1=yes). ERRMAC =: 100 ; Data Access Protocol macrocode error ERRMIC =: 200 ; Data Access Protocol microcode error ERROPT =: 400 ; This field is optional (ie- error analysis terminates ; without issuing "xxx not passed" if missing). .IRP O, .IIF IDN ,, ERRFLG = ERRFLG!ERRSYM .IIF IDN ,, ERRFLG = ERRFLG!ERRCUR .IIF IDN ,, ERRFLG = ERRFLG!ERRBYT .IIF IDN ,, ERRFLG = ERRFLG!ERRALN .IIF IDN ,, ERRFLG = ERRFLG!ERRALN!ERRODD .IIF IDN ,, ERRFLG = ERRFLG!ERRMAC .IIF IDN ,, ERRFLG = ERRFLG!ERRMIC .IIF IDN ,, ERRFLG = ERRFLG!ERROPT .ENDM .IIF NE ERRFLG&ERRMAC ERRFLG = &^C .IIF NE ERRFLG&ERRMIC ERRFLG = &^C .IIF EQ ERRFLG&ERRBYT ERRFLG = &^C .IIF NB , ERRFLG = ERRFLG!ERRSYN .SAVE .IF B .PSECT ERRTXT RO,D,LCL,REL,CON ERRDOT = . .ASCIZ \,%N%9S'TEXT code not available.\ .MACRO ERREXX .SAVE .PSECT ERRTXT RO,D,LCL,REL,CON ERRDOT = . .ASCIZ \,%N%9SUnrecognized TEXT code %FMT'.\ .RESTORE .ENDM ERREXX .IFTF ; B .PSECT ERRTBL RO,D,LCL,REL,CON .IRP N, N: .ENDR .IFT ; B .WORD ERRFLG,ERRDOT .IFF ; B .WORD ERRFLG,SYN .ENDC ; B .RESTORE .ENDM .MACRO ERROR ADDR,CODE,TEXT,NEXT=0 .SAVE .IF NB .PSECT ERRTXT RO,D,LCL,REL,CON .IIF NB ADDR: ERRDOT = . .ASCII \,%N%9S\ .IIF NE ERRFLG&1, .ASCII \CODE - \ .ASCIZ \TEXT%I\ .IFTF ; NB .PSECT ERRTBL RO,D,LCL,REL,CON .IFT ; NB .WORD ERRDOT,CODE .IFF ; NB .WORD ADDR,CODE .ENDC ; NB .WORD NEXT .RESTORE .ENDM .MACRO ERREND CHAIN .SAVE .PSECT ERRTBL RO,D,LCL,REL,CON .IF B ERREXX .WORD 0,MESSAG,ERRDOT .IFF ; B .WORD 0,CHAINR,CHAIN .ENDC ; B .RESTORE .ENDM ERREND ERRLST ERRTBL,,,R ERROR DSWMSG,<^RDSW>,,DSW ERROR IOMSG,<^RIO>,,IO ERROR FCSMSG,<^RFCS>,,IO ERROR FORMSG,<^RFOR>,,FORT ERROR DSWMSG,-1,,DSW ERROR FCSMSG,0,,IO .IF DF NETMSG ERROR ,<^RNET>,,NETERR .ENDC ; DF NETMSG .IF DF NFAMSG ERROR ,<^RNFA>,,NFAERR .ENDC ; DF NFAMSG .IF DF RMSMSG ERROR ,<^RFIL>,,RMSERR ERROR ,<^RRMS>,,RMSERR .IFF ; DF RMSMSG ERROR ,<^RFIL>,,IO .ENDC ; DF RMSMSG ERREND ERRLST FORT,, ERROR ,1., ERROR ,2., ERROR ,3., ERROR ,4., ERROR ,5., ERROR ,6., ERROR ,7., ERROR ,8., ERROR ,9., ERROR ,10., ERROR ,11., ERROR ,12., ERROR ,13., ERROR ,14., ERROR ,20., ERROR ,21., ERROR ,22., ERROR ,23., ERROR ,24.,,FILOPT ERROR ,25., ERROR ,26., ERROR ,27., ERROR ,28., ERROR ,29., ERROR ,30.,,FILOPT ERROR ,31., ERROR ,32., ERROR ,33., ERROR ,34., ERROR ,35., ERROR ,36., ERROR ,37., ERROR ,38.,,FILOPT ERROR ,39.,,FILOPT ERROR ,40., ERROR ,41., ERROR ,42., ERROR ,43., ERROR ,44., ERROR ,45., ERROR ,46., ERROR ,47., ERROR ,48., ERROR ,49., ERROR ,50., ERROR ,51., ERROR ,52., ERROR ,53., ERROR ,54., ERROR ,55., ERROR ,56., ERROR ,57., ERROR ,59., ERROR ,60., ERROR ,61., ERROR ,62., ERROR ,63., ERROR ,64., ERROR ,65., ERROR ,66., ERROR ,67., ERROR ,68., ERREND ERRLST DSWOPT,,SYN=DSW ERRLST DSWSYN,,SYN=DSW ERRLST DSW,, ERROR ISCLR,IS.CLR, ERROR ISSUC,IS.SUC, ERROR ISSET,IS.SET, ERROR IEUPN,IE.UPN, ERROR IEINS,IE.INS, ERROR IEPTS,IE.PTS, ERROR IEUNS,IE.UNS, ERROR IEULN,IE.ULN, ERROR IEHWR,IE.HWR, ERROR IEACT,IE.ACT, ERROR IEITS,IE.ITS, ERROR IEFIX,IE.FIX, ERROR IECKP,IE.CKP, ERROR IETCH,IE.TCH, ERROR IERBS,IE.RBS, ERROR IEPRI,IE.PRI, ERROR IERSU,IE.RSU, ERROR IENSW,IE.NSW, ERROR IEILV,IE.ILV, ERROR IEITN,IE.ITN, ERROR IELNF,IE.LNF, ERROR IEAST,IE.AST, ERROR IEMAP,IE.MAP, ERROR IEIOP,IE.IOP, ERROR IEALG,IE.ALG, ERROR IEWOV,IE.WOV,
ERROR IENVR,IE.NVR, ERROR IENVW,IE.NVW, ERROR IEITP,IE.ITP, ERROR IEIBS,IE.IBS, ERROR IELNL,IE.LNL, ERROR IEIUI,IE.IUI, ERROR IEIDU,IE.IDU, ERROR IEITI,IE.ITI, ERROR IEPNS,IE.PNS, ERROR IEIPR,IE.IPR, ERROR IEILU,IE.ILU, ERROR IEIEF,IE.IEF, ERROR IEADP,IE.ADP, ERROR IESDP,IE.SDP, ERREND .IIF NDF RMSMSG, ERRLST FILOPT,,SYN=IO ERRLST IOOPT,,SYN=IO ERRLST IO,, ERROR IEBAD,IE.BAD, ERROR IEIFC,IE.IFC, ERROR IEDNR,IE.DNR, ERROR IEVER,IE.VER, ERROR IEONP,IE.ONP, ERROR IESPC,IE.SPC, ERROR IEDNA,IE.DNA, ERROR IEDAA,IE.DAA, ERROR IEDUN,IE.DUN, ERROR IEEOF,IE.EOF, ERROR IEEOV,IE.EOV, ERROR IEWLK,IE.WLK, ERROR IEDAO,IE.DAO, ERROR IESRE,IE.SRE, ERROR IEABO,IE.ABO, ERROR IEPRI,IE.PRI ; ERROR IERSU,IE.RSU ; ERROR IEOVR,IE.OVR, ERROR IEBYT,IE.BYT, ERROR IEBLK,IE.BLK, ERROR IEMOD,IE.MOD, ERROR IECON,IE.CON, ERROR IENOD,IE.NOD, ERROR IEDFU,IE.DFU, ERROR IEIFU,IE.IFU, ERROR IENSF,IE.NSF, ERROR IELCK,IE.LCK, ERROR IEHFU,IE.HFU, ERROR IEWAC,IE.WAC, ERROR IECKS,IE.CKS, ERROR IEWAT,IE.WAT, ERROR IERER,IE.RER, ERROR IEWER,IE.WER, ERROR IEALN,IE.ALN, ERROR IESNC,IE.SNC, ERROR IESQC,IE.SQC, ERROR IENLN,IE.NLN, ERROR IECLO,IE.CLO, ERROR IENBF,IE.NBF, ERROR IERBG,IE.RBG, ERROR IENBK,IE.NBK, ERROR IEILL,IE.ILL, ERROR IEBTP,IE.BTP, ERROR IERAC,IE.RAC, ERROR IERAT,IE.RAT, ERROR IERCN,IE.RCN, ERROR IEICE,IE.ICE, ERROR IE2DV,IE.2DV, ERROR IEFEX,IE.FEX, ERROR IEBDR,IE.BDR, ERROR IERNM,IE.RNM, ERROR IEBDI,IE.BDI, ERROR IEFOP,IE.FOP, ERROR IEBNM,IE.BNM, ERROR IEBDV,IE.BDV, ERROR IEBBE,IE.BBE, ERROR IEDUP,IE.DUP, ERROR IESTK,IE.STK, ERROR IEFHE,IE.FHE, ERROR IENFI,IE.NFI, ERROR IEISQ,IE.ISQ, ERROR IEEOT,IE.EOT, ERROR IEBVR,IE.BVR, ERROR IEBHD,IE.BHD, ERROR IEOFL,IE.OFL, ERROR IEBCC,IE.BCC, ERROR IEONL,IE.ONL, ERROR IENNN,IE.NNN, ERROR IENFW,IE.NFW, ERROR IEBLB,IE.BLB, ERROR IENDR,IE.NDR, ERROR IEURJ,IE.URJ, ERROR IENRJ,IE.NRJ,,NETREJ ERROR IEEXP,IE.EXP, ERROR IEBTF,IE.BTF, ERROR IENNC,IE.NNC, ERROR IENDA,IE.NDA, ERROR IENLK,IE.NLK, ERROR IENST,IE.NST, ERROR IEFLN,IE.FLN, ERROR IEIES,IE.IES, ERROR IEPES,IE.PES, ERROR IEALC,IE.ALC, ERROR IEULK,IE.ULK, ERROR IEWCK,IE.WCK, ERROR IENTR,IE.NTR, ERROR IEREJ,IE.REJ, ERROR IEFLG,IE.FLG, ERROR IEDSQ,IE.DSQ, ERROR IEIQU,IE.IQU, ERROR IERES,IE.RES, ERROR IETML,IE.TML, ERROR IENNT,IE.NNT, ERROR IETMO,IE.TMO, ERROR IECNR,IE.CNR, ERROR IEUKN,IE.UKN, ERROR IESZE,IE.SZE, ERROR IEMII,IE.MII, ERROR IESPI,IE.SPI, ERREND .IF DF NETMSG ERRLST NETERR,, ERROR ,-1, ERROR ,-2, ERROR ,-3, ERROR ,-4, ERROR ,-5, ERROR ,-6, ERROR ,-7,,NETREJ ERROR ,-8., ERROR ,-9., ERROR ,-10., ERROR ,-11., ERROR ,-12., ERROR ,-13., ERROR ,-14., ERROR ,-20., ERROR ,-21., ERROR ,-22., ERROR ,-23., ERROR ,-24., ERROR ,-25., ERROR ,-26., ERROR ,-40.,,DSWSYN ERREND CHAIN=IO .ENDC ; DF NETMSG ERRLST NETSYM,,SYN=NETREJ ERRLST NETREJ,, .IF DF NETWRK ERROR ,NE$RES, ERROR ,NE$NOD, ERROR ,NE$NSR, ERROR ,NE$UOB, ERROR ,NE$FMT, ERROR ,NE$MLB, ERROR ,NE$ABM, ERROR ,NE$NNF, ERROR ,NE$NSL, ERROR ,NE$ACC, ERROR ,NE$ABO, ERROR ,NE$COM, .ENDC ; DF NETWRK ERREND ; .IF DF NFAMSG ERRLST NFAERR,, ERROR ,-1, ERROR ,-2, ERROR ,-3,,DAPMAC ERROR ,-4,,NSPERR ERROR ,-5, ERROR ,-6, ERROR ,-7, ERROR ,-8., ERROR ,-9., ERROR ,-10.,,DSWSYN ERROR ,-11., ERREND ERRLST NSPERR,, ERROR ,-1, ERROR ,-2, ERROR ,-3, ERROR ,-4, ERROR ,-5, ERROR ,-6, ERROR ,-7,,NETSYM ERROR ,-8., ERROR ,-9., ERROR ,-10., ERROR ,-11., ERROR ,-12., ERROR ,-13., ERROR ,-14., ERREND ERRLST DAPMAC,, ERROR ,2, ERROR ,4,,FILMIC ERROR ,5,,FILMIC ERROR ,6,,FILMIC ERROR ,7,,FILMIC ERROR ,10, ERROR ,11, ERROR ,12, ERREND ERRLST FILMIC,, ERROR ,1, ERROR ,2, ERROR ,3, ERROR ,4, ERROR ,5, ERROR ,6, ERROR ,7, ERROR ,10, ERROR ,11, ERROR ,12, ERROR ,13, ERROR ,132, ERROR IEHWR,244 ; ERROR IEFHE,245 ; ERROR IEEOF,246 ; ERROR IEONP,247 ; ERROR IEDNA,250 ; ERROR IEDAA,251 ; ERROR IEDUN,252 ; ERROR IERSU,253 ; ERROR IEOVR,254 ; ERROR IEBCC,255 ; ERROR IENOD,256 ; ERROR IEIFU,257 ; ERROR IEHFU,260 ; ERROR IEWAC,261 ; ERROR IECKS,262 ; ERROR IEWAT,263 ; ERROR IEALN,264 ; ERROR IEBTF,265 ; ERROR IEILL,266 ; ERROR IE2DV,267 ; ERROR IEFEX,270 ; ERROR IERNM,271 ; ERROR IEFOP,272 ; ERROR IEVER,273 ; ERROR IEEOV,274 ; ERROR IEDAO,275 ; ERROR IEBBE,276 ; ERROR IEEOT,277 ; ERROR IENBF,300 ; ERROR IENBK,301 ; ERROR IENST,302 ; ERROR IEULK,303 ; ERROR IENLN,304 ; ERROR IESRE,305 ; ; ERROR IEBAD, ; ; ERROR IEIFC, ; ; ERROR IEDNR, ; ; ERROR IESPC, ; ; ERROR IEWLK, ; ; ERROR IEABO, ; ; ERROR IEPRI, ; ; ERROR IEBYT, ; ; ERROR IEBLK, ; ; ERROR IEMOD, ; ; ERROR IECON, ; ; ERROR IEDFU, ; ; ERROR IENSF, ; ; ERROR IELCK, ; ; ERROR IERER, ; ; ERROR IEWER, ; ; ERROR IESNC, ; ; ERROR IESQC, ; ; ERROR IECLO, ; ; ERROR IERBG, ; ; ERROR IEBTP, ; ; ERROR IERAC, ; ; ERROR IERAT, ; ; ERROR IERCN, ; ; ERROR IEICE, ; ; ERROR IEBDR, ; ; ERROR IEBDI, ; ; ERROR IEBNM, ; ; ERROR IEBDV, ; ; ERROR IEDUP, ; ; ERROR IESTK, ; ; ERROR IENFI, ; ; ERROR IEISQ, ; ; ERROR IEBVR, ; ; ERROR IEBHD, ; ; ERROR IEOFL, ; ; ERROR IEONL, ; ; ERROR IENNN, ; ; ERROR IENFW, ; ; ERROR IEBLB, ; ; ERROR IENDR, ; ; ERROR IEURJ, ; ; ERROR IENRJ, ; ,NETREJ ; ERROR IENNC, ; ; ERROR IENDA, ; ; ERROR IENLK, ; ; ERROR IEAST, ; ; same as above ; ERROR IEFLN, ; ; ERROR IEIES, ; ; ERROR IEPES, ; ; ERROR IEALC, ; ; ERROR IEWCK, ; ; ERROR IEIQU, ; ; ERROR IERES, ; ; ERROR IETML, ; ; ERROR IENNT, ; ; ERROR IECNR, ; ; ERROR IEUKN, ; ERREND .ENDC ; DF NFAMSG .IF DF RMSMSG ERRLST FILOPT,,SYN=RMSERR ERRLST RMSERR,, ERROR ,SU$SUC, ERROR ,SU$DUP, ERROR ,SU$IDX, ERROR ,ER$ACC,,IOOPT ERROR ,ER$ACT, ERROR ,ER$AID, ERROR ,ER$ALN, ERROR ,ER$ALQ, ERROR ,ER$ANI, ERROR ,ER$AOP, ERROR ,ER$ATR,,IOOPT ERROR ,ER$ATW,,IOOPT ERROR ,ER$BKS, ERROR ,ER$BKZ, ERROR ,ER$BOF, ERROR ,ER$BPA, ERROR ,ER$BPS, ERROR ,ER$CCR, ERROR ,ER$CHG, ERROR ,ER$CHK, ERROR ,ER$CLS,,IOOPT ERROR ,ER$COD, ERROR ,ER$CRE,,IOOPT ERROR ,ER$CUR, ERROR ,ER$DAN, ERROR ,ER$DEL, ERROR ,ER$DEV, ERROR ,ER$DFW,,IOOPT ERROR ,ER$DIR, ERROR ,ER$DME, ERROR ,ER$DNA, ERROR ,ER$DNF, ERROR ,ER$DNR, ERROR ,ER$DPE, ERROR ,ER$DTP, ERROR ,ER$DUP, ERROR ,ER$ENT,,IOOPT ERROR ,ER$ENV, ERROR ,ER$EOF, ERROR ,ER$ESA, ERROR ,ER$ESL, ERROR ,ER$ESS, ERROR ,ER$EXP, ERROR ,ER$EXT,,IOOPT ERROR ,ER$FAC, ERROR ,ER$FAL, ERROR ,ER$FEX, ERROR ,ER$FID, ERROR ,ER$FLG, ERROR ,ER$FLK, ERROR ,ER$FNA, ERROR ,ER$FND,,IOOPT ERROR ,ER$FNF, ERROR ,ER$FNM, ERROR ,ER$FOP, ERROR ,ER$FUL, ERROR ,ER$IAN, ERROR ,ER$IDX, ERROR ,ER$IFI, ERROR ,ER$IMX, ERROR ,ER$IOP, ERROR ,ER$IRC, ERROR ,ER$ISI, ERROR ,ER$KBF, ERROR ,ER$KEY, ERROR ,ER$KRF, ERROR ,ER$KSZ, ERROR ,ER$LAN, ERROR ,ER$LBL, ERROR ,ER$LBY, ERROR ,ER$LCH, ERROR ,ER$LEX, ERROR ,ER$LOC, ERROR ,ER$MEM, ERROR ,ER$MKD,,IOOPT ERROR ,ER$MRN, ERROR ,ER$MRS, ERROR ,ER$NAE, ERROR ,ER$NAM, ERROR ,ER$NEF, ERROR ,ER$NET, ERROR ,ER$NMF, ERROR ,ER$NOD, ERROR ,ER$NPK, ERROR ,ER$ORD, ERROR ,ER$ORG, ERROR ,ER$PLG, ERROR ,ER$PLV, ERROR ,ER$POS, ERROR ,ER$PRM, ERROR ,ER$PRV, ERROR ,ER$RAC, ERROR ,ER$RAT, ERROR ,ER$RBF, ERROR ,ER$RER,,IOOPT ERROR ,ER$REX, ERROR ,ER$RFA, ERROR ,ER$RFM, ERROR ,ER$RLK, ERROR ,ER$RMV,,IOOPT ERROR ,ER$RNF,,RMSERR ERROR ,ER$RNL, ERROR ,ER$ROP, ERROR ,ER$RPL,,IOOPT ERROR ,ER$RRV, ERROR ,ER$RSL, ERROR ,ER$RSS, ERROR ,ER$RST, ERROR ,ER$RSZ, ERROR ,ER$RTB, ERROR ,ER$RVU, ERROR ,ER$SEQ, ERROR ,ER$SHR, ERROR ,ER$SIZ, ERROR ,ER$SUP, ERROR ,ER$SYS,,DSWOPT ERROR ,ER$TRE, ERROR ,ER$TYP, ERROR ,ER$UBF, ERROR ,ER$UIN, ERROR ,ER$USZ, ERROR ,ER$VER, ERROR ,ER$WCD, ERROR ,ER$WER,,IOOPT ERROR ,ER$WLK, ERROR ,ER$WPL,,IOOPT ERROR ,ER$XAB, ERROR ,ER$XTR, ERREND .ENDC ; DF RMSMSG .PSECT PURTXT RO,D,LCL,REL,CON .NLIST BEX GBLMSG: .ASCIZ \%2R - %Y %3Z - \ .EVEN .LIST BEX .PSECT IMPDAT RW,D,LCL,REL,CON PUNCT: .BLKW 1 ; End punctuation. ERRBAD: .BLKW 1 ; Addr. of front of error message buffer ERRADR: .BLKW 1 ; Addr. of error code. ERRLUN: .BLKW 1 ; LUN for output. ERRBLD: .BLKW 20. ; Error parameters block. ERRBUF: .BLKW 128. ; Error message buffer. ERRBFA: .BLKW 1 ; Address in error message buffer. .ASECT .=0 NARG: .BLKW 1 ; Number of arguments. LUN: .BLKW 1 ; Address of LUN. USRTXT: .BLKW 1 ; User text. USRPRM: .BLKW 1 ; Params with user text. ERS: .BLKW 1 ; Start of error params. .PSECT PURCOD RO,I,LCL,REL,CON .ENABL LSB ; For alternate entry. ERRORF::MOV LUN(R5),ERRBAD ; Get the user's buffer address. CLR ERRLUN ; No error LUN. BR 10$ ; Join common code. ERRORS::MOV #ERRBUF,ERRBAD ; Save error message address. MOV @LUN(R5),ERRLUN ; Save LUN number. 10$: CALL $SAVAL ; Save registers to work with. MOV ERRBAD,R0 ; Get the buffer address. MOV #'.,PUNCT ; Set up default punctuation. CLR R2 ; Use R2 as option flag. MOV USRTXT(R5),R4 ; Get the user text. CMP R4,#-1 ; Was it passed? BNE 20$ ; If so, use it. CLR R4 ; If not, zero is easier to check. MOVB #40,(R0)+ ; Also, default to single-space. BR 100$ ; Skip all the user junk. 20$: CLR R1 ; Get the next BISB (R4)+,R1 ; character. CMPB R1,#'% ; Is it the magic percent? BEQ 30$ ; If so, handle. CMPB R1,#'. ; Is it the magic dot? BEQ 40$ ; If so, handle. CMPB R1,#'P ; Is it the magic "P"? BEQ 50$ ; If so, handle. CMPB R1,#'@ ; Is it the "@" (proxy for null)? BNE 100$ ; If not, it's normal form control. CLR R1 ; If so, put in an honest-to-God null. BR 100$ ; Go process time and date. 30$: BIS #100000,R2 ; Flag no standard header. BR 20$ ; Go get the next character. 40$: CLR PUNCT ; No punctuation. BR 20$ ; Go get the next character. 50$: MOVB (R4)+,PUNCT ; Next char. is desired punct. BR 20$ ; Go get the next character. 100$: MOVB R1,(R0)+ ; Save the carriage control. TST R2 ; Want the standard header? BLT 110$ ; If not, don't bother. MOV #ERRBLD,R2 ; Point to parameter block. GTSK$S R2 ; Get our task name. GTIM$S #ERRBLD+4 ; Get the current time. MOV #GBLMSG,R1 ; Get the format for it. CALL $EDMSG ; Format it all. 110$: MOV R4,R1 ; Get the user's data. BEQ 120$ ; If there ain't none, fergit it. MOV USRPRM(R5),R2 ; Get the data block address. CALL $EDMSG ; Format the data. 120$: MOV R0,ERRBFA ; Save our current location. CLR R4 ; Get the number of BISB NARG(R5),R4 ; arguments. MOV #ERRBLD,R3 ; Point to error data block. MOV #ERRTBL,R2 ; Point to the error analysis table. ADD #ERS,R5 ; Point to the first error arg. SUB #ERS/2-1,R4 ; Find the number of error arguments. BGT NXTARG ; If we have some, analyze them. JMP WRITE ; If not, just write what we have. .DSABL LSB ; End of shared code. NXTARG: MOV ERRADR,R0 ; Assume reprocessing previous entry. BIT #ERRCUR,(R2) ; Want to get another arg? BNE 10$ ; If not, proceed with the current one. DEC R4 ; All out of them? BLT MESSAO ; If so, log the missing data. MOV (R5)+,R0 ; Get the address of the data. CMP R0,#-1 ; Is it null? BEQ MESSAO ; If so, log missing data. 10$: BIT #ERRALN,(R2) ; Need to word align the address? BEQ 20$ ; If not, proceed. CLR -(SP) ; If so, assume word align. BIT #ERRODD,(R2) ; Want odd alignment? BEQ 15$ ; If not, go align. INC (SP) ; If so, set it up, and DEC R0 ; knock off the odd bit. 15$: INC R0 ; Align to next BIC #1,R0 ; even address. ADD (SP)+,R0 ; Go to next odd if needed. 20$: MOV R0,R1 ; Copy the address. BIT #ERRBYT,(R2) ; Is this a byte argument? BNE 30$ ; If so, go get it. MOV (R1)+,R0 ; Get the word argument. BIT #ERRMAC!ERRMIC,(R2) ; Is it a DAP error? BEQ 40$ ; If not, fine. MOV #170000,-(SP) ; Assume microcode. BIT #ERRMIC,(R2) ; Is it a microcode? BNE 25$ ; If so, handle it. TST -(R1) ; Back up the error addr. ASH #-12.,R0 ; Put code in low byte. MOV #^C17,(SP) ; Mask for macrocode. 25$: BIC (SP)+,R0 ; Clear unwanted bits. BR 40$ ; Go on about our business. 30$: MOVB (R1)+,R0 ; Get the byte argument. MOVB R0,R0 ; Sign-extend the code. 40$: MOV R1,ERRADR ; Save the address of this arg. BIT #ERRSYN,(R2) ; Is this a synonym entry? BEQ PROCES ; If not, go process it. TST (R2)+ ; If so, point to synonym address, ; and fall thru to chaining code. CHAINR: MOV (R2),R2 ; Get new table address. PROCES: ADD #4,R2 ; Skip initial data. 10$: MOV (R2)+,R1 ; Get prospective text address. BEQ 50$ ; If none, at end. CMP (R2)+,R0 ; Is this the error? BEQ 40$ ; If so, use it. TST (R2)+ ; If not, skip data, BR 10$ ; and try again. 40$: MOV R1,(R3)+ ; Save the message. MOV (R2)+,R2 ; Got more chain? BNE NXTARG ; If so, run it. BR WRITE ; If not, quit. 50$: JMP @(R2)+ ; Go process appropriately MESSAO: BIT #ERROPT,(R2)+ ; Was the datum optional? BNE WRITE ; If so, fall thru and write. MESSAG: MOV (R2)+,(R3)+ ; No match. get default error msg, MOV R0,(R3)+ ; and code. ; Fall thru and write. WRITE: MOV #PUNCT,(R3)+ ; Punctuate the text. MOV #ERRBLD,R2 ; Get the address of the build block. MOV ERRBFA,R0 ; Get the error buffer. MOV (R2)+,R1 ; Get the edit string. CALL $EDMSG ; Build the message. MOV ERRBAD,R1 ; Get edit buffer. CLR R2 ; Get desired form BISB (R1)+,R2 ; control. SUB R1,R0 ; Find length of buffer. BEQ 60$ ; If none, quit. TST ERRLUN ; Is there a LUN? BGT 50$ ; If so, write it. MOV R0,2(SP) ; If not, return size in R0, BR 60$ ; and return to caller. 50$: QIOW$S #IO.WVB,ERRLUN,#32.,,,, ; Write. 60$: RETURN ; Return to caller. .END