.MCALL .MODULE .MODULE SYTRP,VERSION=04,COMMENT=^\SYSLIB/$SYTRP\,IDENT=NO,LIB=YES ; 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 $SYTRP - Error Trap Definition/Handler for SYSLIB ;+ ; This module can be linked with a user program when no FORTRAN OTS ; is present. It provides a simple TRAP handler to intercept errors ; produced by incorrectly written SYSLIB calls. ; ; GLOBAL DEFINITIONS - Defining $MSARG as .WEAK causes it to be ; omitted from the library directory (and most links). This module ; is normally not used. It must be requested explicitly. The value ; $MSARG is normally defined by a FORTRAN OTS, or not at all. ; ; If a user wants this module, it can be retrieved by referencing ; global $SYTRP. ;- .NLIST BEX .SBTTL Definitions: .SBTTL . $MSARG Definition .WEAK $MSARG ; Invisible definition .GLOBL $SYSLB ; Include system library work area. $MSARG ==: 128.+1. ; Global definition of $MSARG .SBTTL . Macro references .MCALL .PRINT, .EXIT .LIBRARY "SRC:SYSTEM.MLB" .MCALL .SAVDF .SYCDF .UEBDF .SYCDF .UEBDF .SAVDF E==: .SBTTL . TRAP Vector Contents .ASECT . = SV.NID ;any .SAV file linked .WORD 000001 ;to CMPLT. .=34 ; TRAP vector .WORD $SYTRP ; PC after TRAP .WORD 030000 ; PS = USER-USER, priority 0 .SBTTL . Error Message Text .PSECT SYS$S,D MSG1: .ASCIZ /?SYSLIB-F-Invalid argument/ MSG2: .ASCIZ /?SYSLIB-F-Unknown error/ .EVEN .SBTTL $SYTRP - TRAP Handler Code .PSECT SYS$I,I $SYTRP:: ; Trap handler entry point MOV @SP,R0 ; get old PC CMP -2(R0),#TRAP+$MSARG ; was it OUR trap? BNE 10$ MOV #MSG1,R0 ; print error message, BR 20$ 10$: MOV #MSG2,R0 ; print error message, 20$: .PRINT CMP (SP)+,(SP)+ ; eat PS and PC caused by TRAP ..WARN::BISB #ERROR$,@#$USRRB ; announce error condition .EXIT ; exit program. .END