.Title UE ;Universal Error Message Interface .Globl UE,PE ; for FORTRAN-IV and FORTRAN-77. .MCall .Exit ;Copyright (C) 1986 by DSSI. ;Fortran callable routine to force the display of both the usual terse ; error message as well as a verbose error message text (produced by ; SY:PE.SAV) on any Fatal Error condition. To use this facility just ; "CALL UE" from your Fortran program. For overlaid programs, this ; routine must remain memory resident at all times (ie. keep it in the ; ROOT segment; the whole interface is only 43 words long). The files ; PE.SAV and PE.BIN must be installed on the system device. ; ; Written by: Daniel P. Graham 9-MAR-86 ; Digital Software Systems, Inc. UE: Mov #UsrArg,R5 ;Setup our arg list for a USEREX call. Jsr Pc,Userex ;Define PE as our User Exit routine. Rts Pc ;Return to caller; continue normally. ;If a FATAL error occurs at any time after UE is called then FORTRAN ; will display its usual 2 or 3 line terse error message, perform ; all of its usual termination functions, and then pass control (ie. ; JMP) to label PE:. PE: Mov #SnsArg,R5 ;Get the FORTRAN internal error number Jsr Pc,Errsns ; for the last error encountered. Tst Error ;Was there an error? Beq Chain ;No - just exit quietly to KMON Conv: Mov #String+13.,R4 ;Get address of end of ASCII error #. Mov Error,R1 ;Put the error number into R1. Loop: Beq Set ;When R1 is zero, we're done. Clr R0 ;Set R0 to Zero. Div #10.,R0 ;Divide by 10;R0=Quotient,R1=Remainder Add #48.,R1 ;Convert the remainder to ASCII Movb R1,-(R4) ;Save it in the PE command string Mov R0,R1 ;Save the quotient as the new dividend Br Loop ;Convert the next digit Set: Mov #CmdArg,R5 ;Setup our arg list for a SETCMD call. Jsr Pc,Setcmd ;Use SY:PE to decode the last error. Chain: .Exit ;Chain to SY:PE.SAV UsrArg: .Word 1 ;Number of args in Userex call Error: .Word PE ;Our local User Exit address SnsArg: .Word 1 ;Number of args in Errsns call .Word Error ;Address of last Fortran Error Number CmdArg: .Word 1 ;Number of args in Setcmd call .Word String ;Address of string to pass to KMON String: .Asciz /Run SY:PE 000 /;Initial string to pass to KMON .End ;End of Macro routine UE