.MCALL .MODULE .MODULE ISAVES,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 in 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 .SAVESTATUS ; SAVESTATUS programmed request. ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRP0 ; Entry point to EMT error conversion routine. .GLOBL $NXADR ; Entry point to next address routine. .GLOBL $NXVAL ; Entry point to next value routine. .GLOBL $SYSLB ; Include system library work area. .WEAK $MSARG ; Trap code for missing argument .SBTTL ISAVES - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The ISAVES routine stores five words of channel status information ; into a user-specified block. These words contain all the info that ; RT-11 requires to completely define a file. When an ISAVES is done, ; the channel status words are placed in memory, the specified channel ; is freed, and the file is closed. ; ; CALLING SEQUENCE: ; ; i = ISAVES( chan, cblk ) ; ; INPUT PARAMETERS: ; ; R5 - address of ISAVES's argument block ; ; 0(R5) - argument count of ISAVES call ; 2(R5) - address of channel number to save status info ; 4(R5) - address of five-word block in which channel status info ; describing the opened file is stored ; ; OUTPUT PARAMETERS: ; ; R0 - save channel info status ; ; cblk - address of five-word block loaded with file status: ; word 1 - channel status word ; word 2 - starting block no. of file ; word 3 - length of file ; word 4 - reserved for future use ; word 5 - i/o count of outstanding requests; and unit ; no. associated with the channel ; ; RETURNED FUCTION VALUE: ; ; i = 0 no error doing savestatus ; = 1 the specified channel is not currently associated with any file ; = 2 the file was opened with IENTER call ; -- .PSECT SYS$I SAVES:: ; Entry point to ISAVES routine. ISAVES:: ; Entry point to ISAVES routine. MOV (R5)+,R4 ; R4 <- argument count. CALL $NXVAL ; Get 'chan' argument BCS ERR ; If CS, error - 'chan' wasn't supplied MOV R0,R3 ; R3 <- channel no. to use for .SAVESTATUS. CALL $NXADR ; Get -> 'cblk' argument BCS ERR ; If CS, error - 'cblk' wasn't supplied MOV R0,R2 ; R2 <- address of channel status block. CMP -(SP),-(SP) ; Allocate space for SAVESTATUS's argument block. .SAVESTATUS SP,R3,R2 ; Save status information for specified channel. BIT (SP)+,(SP)+ ;*C* Purge stack of argument block. CALLR $ERRP0 ; Get and convert any errors (status in R0) ; and return to caller with status in R0. ERR: TRAP $MSARG ; Handle any missing arguments in call RETURN .END