.MCALL .MODULE .MODULE IENTER,VERSION=08,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, but cannot be called from a ; completion or interrupt service routine. It uses "TRAP" to ; provide error processing. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .ENTER ; ENTER programmed request. ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area .GLOBL $ERRM0 ; Entry point to EMT error conversion routine .GLOBL $NXADR ; Entry point to next address routine .GLOBL $NXVAL ; Entry point to next value routine .WEAK $MSARG ; Trap code for missing argument .SBTTL IENTER - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The IENTER function allocates space on the specified device and ; creates a tentative directory entry for the named file. If a file of ; the same name already exists on the specified device, it is not ; deleted until the tentative entry is made permanent by closing the ; file. The file is attached to the channel number specified. ; ; CALLING SEQUENCE: ; ; i = IENTER( chan, dblk, length [,seqnum] ) ; ; INPUT PARAMETERS: ; ; R5 - address of IENTER's argument block ; ; 0(R5) - argument count of IENTER call ; 2(R5) - address of channel number to be associated with the file ; 4(R5) - address of four-word Radix-50 descriptor of file ; 6(R5) - address of number of blocks to allocate for file ; 10(R5) - address of file no. for cassette operations; if argument ; is omitted, value is defaulted to 0 ; ; RETURNED FUNCTION VALUE: ; ; i = +n - number of blocks 'n' actually allocated for file ; -1 - channel ('chan') is already in use ; -2 - in a fixed-length request, not enough space available to ; satisfy 'length' argument ; -3 - device in use ; -4 - file by that already exists and is protected ; -5 - file sequence number not found ; -6 - file sequence number invalid ; -7 - invalid unit on special directory device ; ; -- .PSECT SYS$I ENTER:: IENTER:: MOV (R5)+,R4 ; R4(low byte) <- argument count. CALL $NXVAL ; Get 'chan' argument BCS ERR ; If CS, error - 'chan' argmnt wasn't supplied MOV R0,R3 ; R3 -> channel no. to use for .ENTER CALL $NXADR ; Get -> 'dblk' argmnt BCS ERR ; If CS, error - 'dblk' argmnt wasn't supplied MOV R0,R2 ; R2 <- address of descriptor of file to enter CALL $NXVAL ; Get 'length' argument BCS ERR ; If CS, error - 'length' wasn't supplied MOV R0,R1 ; R1 <- no. blocks to allocate for file. CLR R0 ; Default 'seqnum' to 0 - in case it's omitted CALL $NXVAL ; Get 'seqnum' argument; it's returned in R0 MOV R0,-(SP) ; Store 'seqnum' in ENTER's argument block SUB #6,SP ; Allocate remaining space required for ENTER' ; argument block .ENTER SP,R3,R2,R1 ; Enter named file on specified device BCC 10$ ; No error, return R0 contents CALL $ERRM0 ; Get and convert any errors (status in R0) 10$: ADD #8.,SP ; Purge stack of argument block RETURN ; Return to caller with status in R0 ERR: TRAP $MSARG ; Handle any missing arguments in call RETURN .END