.MCALL .MODULE .MODULE IREADF,06,COMMENT=,IDENT=NO,LIB=YES,GLOBAL=.READF ; 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 Declaration .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; CALLABLE ENTRIES: ; ; IREADF ; ; ENVIRONMENT: ; ; These routines 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 .READC ; READC programmed request ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area. .GLOBL $NOARG ; Missing argument code ; .GLOBL $READ ; Entry point to IREAD common code .GLOBL $CMPLT ; Entry point to det-up linkage to a FORTRAN ; completion routine .GLOBL $NXVAL ; Entry point to next value routine. .GLOBL $NXADR ; Entry point to next address routine .GLOBL $ERRM0 ; Entry point to EMT error conver rtn .WEAK $MSARG ; Trap code for missing argument .SBTTL IREADF - Fortran-callable routines ; ++ ; FUNCTIONAL DESCRIPTION: ; ; IREADF - transfers into memory a specified number of words from ; the file associated with the indicated channel. Control ; returns to the user program immediately. When the operation ; is completed, the specified FORTRAN language routine(CRTN) ; is entered as an asynchronous completion routine. ; ; ; CALLING SEQUENCE: ; ; I = IREADF( wcnt, buff, blk, chan, area, crtn ) ; ; ; INPUT PARAMETERS: ; ; R5 - address of IREADF argument block ; 0(R5) - argument count ; 2(R5) - address of the number of words to be read ; 4(R5) - address of the buffer to receive the data read ; 6(R5) - address of the block number to be read ; 10(R5) - address of a channel number ; 12(R5) - address of the four-word area to be set aside for link ; information ; 14(R5) - address of the user's FORTRAN routine to be activated ; ; ; OUTPUT PARAMETERS: ; ; R0 - function status ; ; ROUTINE VALUE: ; ; I = N Normal return, n= # words being read ; = -1 Attempt to read past end-of-file ; = -2 Hard error occurred on channel ; = -3 Channel is not open ; ; MODIFICATION HISTORY: ; ; 13-APR-1997 Tim Shoppa ; IREADF was badly broken in 5.6 when IREAD.MAC was ; "upgraded" to mapped environment operation. The entry ; point $READ:: in IREAD.MAC is now useless for IREADF's ; purposes. So now IREADF no longer calls common code ; in IREAD - instead, it is all self-contained. ;-- ; .PSECT SYS$I READF:: IREADF:: CMPB #6,@R5 ; all arg presented ? BNE ERR1 ; no, then err ADD #12,R5 ; R5 -> addr of area CMP #$NOARG,@R5 ; area missing ? BEQ ERR1 ; yes, then err CMP #$NOARG,2(R5) ; crtn missing ? BEQ ERR1 ; yes, then err MOV (R5)+,R1 ; R1 -> area MOV R1,-(SP) ; stack complt. rtn. addr CALL $CMPLT ; set up linkage area SUB #14,R5 ; back to first arg MOV SP,R1 TST (R1)+ ; save org stack pntr MOV (R5)+,R4 ; R4 (low byte) contains arg count CALL $NXVAL ; get WCNT BCS ERR MOV R0,-(SP) ; store WCNT on stack CALL $NXADR ; get BUFF BCS ERR MOV R0,-(SP) ; store BUFF on stack CALL $NXVAL ; get BLK number BCS ERR MOV R0,-(SP) ; store BLK number on stack CALL $NXVAL ; get CHAN BCS ERR MOV R0,-(SP) ; store CHAN on stack .READC SP ; perform .READC call MOV R1,SP ; restore stack pntr BCC RTRN ; no EMT error then return (value in R0) CALLR $ERRM0 ; Get and convert any errors (status in R0) ERR: MOV R1,SP ; restore stack pntr ERR1: TRAP $MSARG ; Handle any missing arguments in call; RTRN: RETURN .END