.MCALL .MODULE .MODULE JRDWF,VERSION=05,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. Under XM monitor, these routines ; require that the AT pseudohandler be loaded in memory to provide ; address translation. ; ; CALLABLE ENTRIES: ; ; JREADF, JWRITF ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library .MCALL .SPFUN .MCALL .BR ; ; EQUATED SYMBOLS: ; SF.W32 =: 366 ;fnctn code for write with 32-bit block number SF.R32 =: 367 ;fnctn code for read with 32-bit block number ; EXTERNAL REFERENCES: ; .GLOBL $NXVAL ; Entry point to next value routine .GLOBL $NXADR ; Entry point to next address routine .GLOBL $SYSLB ; Include system library work area .GLOBL $ERRM0 ; Convert and return any error .GLOBL $NOARG ; missing arg code .GLOBL $JRWRT ; common code .GLOBL $CMPLT ; Entry point to $CMPLT routine .GLOBL $ARGER ; missing argument error for new routines .SBTTL JREADF, JWRITF - Fortran-callable Routine ; ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The JREADF function transfers into memory a specified number of words ; from the indicated channel. The monitor returns control to the user ; program immediately after the JREADF function is initiated. When the ; operation is complete, the monitor enters the specified FORTRAN sub- ; program (crtn) as an asynchronous completion routine. ; ; The JWRITF function transfers a specified number of words from memory ; to the indicated channel. The monitor returns control to the user ; program immediately after queuing the request. When the transfer is ; complete, the monitor enters the specified FORTRAN subprogram (crtn) ; as an asynchronous completion routine. ; ; ; CALLING SEQUENCE: ; ; i = JREADF( wcnt, buff, jblock, chan[ ,area], lblk, crtn) ; ; i = JWRITF( wcnt, buff, jblock, chan[ ,area], lblk, crtn) ; ; INPUT PARAMETERS: ; ; R5 - address of JREADF/JWRITF argument block ; ; 0(R5) - argument count of JREADF/JWRITF call ; 2(R5) - address of the integer number of words to be transferred ; 4(R5) - address of the array to be used as the buffer ; ; 6(R5) - address of the 2-word(32-bit) starting block number of the ; MSCP device ; ; 10(R5) - address of the integer specification for the RT-11 channel ; ; 12(R5) - address of a 80-word work area that is requested for compata- ; bility with a previous release - now ignored ; 14(R5) - address of the 4-word area to be set aside for link informa- ; tion ; 16(R5) - address of the FORTRAN completion routine ; ; RETURNED FUNCTION VALUE: ; ; i = 0 - Normal return ; -2 - Hardware error occurred on channel on last completed operarion ; -3 - Specified channel is not open ; -4 - Invalid device (not DU) ; -5 - Channel was open not as a device ; -6 - AT is not loaded ;- .PSECT SYS$I,I .ENABLE LSB JREADF:: MOV #,R4 ;set READ funct code BR JRDWRF JWRITF:: MOV #,R4 ;set WRITE funct code .BR JRDWRF JRDWRF: CMPB #7,@R5 ;all arg present ? BNE ERR ;no, then indicate missing argument ADD #14,R5 ;R5 -> addr of 'lblk' MOV (R5)+,R1 ;R1 = addr of 'lblk' CMP R1,#$NOARG ;'lblk' present ? BEQ ERR ;no, then indicate missing argument CMP @R5,#$NOARG ;'crtn' present ? BEQ ERR ;no, then indicate missing argument ;R5 -> 'crtn' MOV R1,-(SP) ;stack 'lblk' addr to be used ;for SPFUN as 'crtn' CALL $CMPLT ;set up linkage area with R1 and R5 SUB #16,R5 ;back to second argument MOV R4,-(SP) ;stack 'fnct' code CALLR $JRWRT ;join common code ERR: MOV #$ARGER,R0 ;indicate missing argument error RETURN .END