.MCALL .MODULE .MODULE DEVICE,VERSION=04,COMMENT=,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 Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; ENVIRONMENT: ; ; This routine can be used by any job running in a single-job ; or multi-job environment. It uses "TRAP" to provide error ; processing. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .DEVICE ; DEVICE programmed request. ; ; EQUATED SYMBOLS: ; DEV.EMT = 14*400 ; Define id request code for DEVICE EMT. ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRM0 ; Entry point to EMT error conversion routine. .GLOBL $NXADR ; Entry point to next address routine. .GLOBL $SYSLB ; Include system library work area. .WEAK $MSARG ; Trap code for missing argument .SBTTL DEVICE - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The DEVICE routine allows you to set-up a list of addresses to be ; loaded with specified values when a job is terminated. If a job ; terminates or is aborted with ctrl/c from the terminal, the list is ; picked-up by the system and appropriate addresses are set-up with ; corresponding values. ; ; CALLING SEQUENCE: ; ; CALL DEVICE( ilist [,link] ) ; i = IDEVICE( ilist [,link] ) ; ; INPUT PARAMETERS: ; ; R5 - address of DEVICE's argument block ; ; 0(R5) - argument count of DEVICE call ; 2(R5) - address of list of two-word elements (address/value pairs) ; 4(R5) - address of optional argument if present specifies linking of ; tables on successive calls to DEVICE ; ; ERRORS: ; ; 0 - success ; -1 - address error ; -- .PSECT SYS$I IDEVIC:: ; Entry point to DEVICE routine. DEVICE:: ; Entry point to DEVICE routine. MOV (R5)+,R4 ; R4 <- argument count. CALL $NXADR ; Get -> 'ilist' argument; it's returned in R0 ; if supplied by caller. BCS 20$ ; If CS, error - 'ilist' argument wasn't ; supplied; report missing argument in call. MOV R0,-(SP) ; Store address of address/value table in ; DEVICE's argument block. MOV #DEV.EMT,-(SP) ; Default 'ilink' to 0 - in case it's omitted. CALL $NXADR ; Is this a linking DEVICE call? BCS 10$ ; If CS, no - it's a non-linking DEVICE call. INC @SP ; Otherwise, indicate that it's a linking DEVICE call. 10$: .DEVICE SP,,CODE=NOSET ; Establish clean-up table for job termination. BIT (SP)+,(SP)+ ;*C* Purge stack of argument block. CALLR $ERRM0 ; Get and convert any errors (status in R0) ; and return to caller with status in R0. 20$: TRAP $MSARG ; Handle any missing arguments in call RETURN .END