.MCALL .MODULE .MODULE ICSTAT,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 ; ; ICSTAT ; ; 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 .CSTAT ; CSTAT programmed request. ; ; EQUATED SYMBOLS: ; CS.UNT = 10 ; offset to device unit number CS.NAM = 12 ; offset to physical device name ; ; 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. .GLOBL $RD5AS ; Entry point to RAD50 to ASCII conversion .GLOBL $DEVTR ; Entry point to device translation routine .WEAK $MSARG ; Trap code for missing argument .SBTTL ICSTAT - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The ICSTAT routine obtains information about a specified channel. ; ; CALLING SEQUENCE: ; ; i = ICSTAT( chan, addr [,strng] ) ; ; INPUT PARAMETERS: ; ; R5 - address of ICSTAT's argument block ; ; 0(R5) - argument count of ICSTAT call ; 2(R5) - address of channel number to interrogate ; 4(R5) - address of six-word area to receive channel info ; 6(R5) - address of three-character area to receive ASCII string of ; device name+unit number ; ; RETURNED OUTPUT PARAMETERS: ; ; addr - six-word area loaded with channel status: ; word 1 - channel status word ; word 2 - starting block no. of file ; word 3 - length of file ; word 4 - highest block no. written ; word 5 - unit no. of device ; word 6 - radix-50 of device name ; ; strng - three-character area ASCII string of device name+unit number ; associated with specified channel ; ; RETURNED FUNCTION VALUE: ; ; i = 0 - no error getting channel info ; 1 - channel specified is not open ; -- .PSECT SYS$I CSTAT:: ICSTAT:: MOV (R5)+,R4 ; R4(low byte) <- argument count. CALL $NXVAL ; Get 'chan' argument; it's returned in R0 BCS ERR ; If CS, error - 'chan' wasn't supplied MOV R0,R1 ; R1 <- chan # to use in .CSTAT CALL $NXADR ; Get -> 'addr' argument; it's returned in R0 BCS ERR ; If CS, error - 'addr' wasn't supplied MOV R0,R2 ; R2 <- address of channel status info buffer CMP -(SP),-(SP) ; Allocate space for CSTAT's argument block .CSTAT SP,R1,R2 ; Get information for specified channel BIT (SP)+,(SP)+ ;*C* Purge stack of argument block CALL $ERRP0 ; Get and convert any errors (status in R0) MOV R0,-(SP) ; Save Error code CALL $NXADR ; Was 'strng' argt supplied ? BCS RTN ; no, then return MOV R0,R5 ; R5 -> strng output area MOV CS.UNT(R2),R1 ; R1 = device binary unit # MOV CS.NAM(R2),R0 ; R0 = RAD50 device name CALL $DEVTR ; convert RAD50 dev name (one or two letter) ; and binary unit #(up to 64) ; into RAD50 dev name + unit #,returned in R0 CALL $RD5AS ; convert one RAD50 word to ASCII (R50ASC.MAC) RTN: MOV (SP)+,R0 ; restore error code RETURN ERR: TRAP $MSARG ; Handle any missing arguments in call RETURN .END