.MCALL .MODULE .IIF NDF SYSL$X, SYSL$X = 0 ;Build I-form routines by default .IF EQ SYSL$X .MODULE IRCVD,VERSION=05,COMMENT=,IDENT=NO,LIB=YES .IFF ;EQ SYSL$X .MODULE MRCVD,VERSION=05,COMMENT=,IDENT=NO,LIB=YES .ENDC ;EQ SYSL$X ; 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 (SYSLIB) ; ; CALLABLE ENTRIES: ; ; IRCVD, IRCVDC, IRCVDW ; or ; MRCVD, MRCVDC, MRCVDW ; ; ENVIRONMENT: ; ; The I-form routines can be used by any job running in a multi- ; job environment. ; ; The M-form routines can be used by any job running in a multi- ; job mapped environment. ; ; "TRAP" is used to provide error processing. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .BR .MCALL .RCVDC ; RCVDC programmed request. .LIBRARY "SRC:SYSTEM.MLB" .MCALL ..RCVD ..RCVD ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area. .GLOBL $NXADR ; Entry point to next address routine .GLOBL $NXVAL ; Entry point to next value routine .GLOBL $ERRP0 ; Entry point to EMT error conversion routin. .GLOBL $NOARG ; missing argument = - 1 .WEAK $MSARG ; FORTRAN fatal error - missing argument .IF NE SYSL$X .GLOBL $BCMOD ;Routine to handle BMODE and CMODE arguments .ENDC ;NE SYSL$X ; ; CONDITIONALS: ; ; SYSL$X (0) Build I-form library routines ; 1 Build M-form library routines ; ;- .SBTTL {I|M}RCVD{_|C|W} - Fortran Callable Routines ;+ ; ; FUNCTIONAL DESCRIPTION: ; ; {I|M}RCVD ; Posts a request to receive data from another job on ; the system. Program execution continues. Completion ; occurs asynchronously and must be checked for. ; {I|M}RCVDC ; Posts a request to receive data from another job on ; the system. Program execution continues. When the ; request completes, the specified asynchronous completion ; routine is executed. ; {I|M}RCVDW ; Posts a request to receive data from another job on ; the system. Program execution continues when the ; request completes. ; ; CALLING SEQUENCE: ; ; i = IRCVD ( buf, wcnt ) ; i = IRCVDW ( buf, wcnt ) ; i = IRCVDC ( buf, wcnt, crtn ) ; ; i = MRCVD ( buf, wcnt [,bmode] ) ; i = MRCVDC ( buf, wcnt, crtn [,bmode] [,cmode] ) ; i = MRCVDW ( buf, wcnt [,bmode] ) ; ; INPUT PARAMETERS: ; ; R5 address of argument block ; 0(R5) argument count ; 2(R5) address of array to be used to buffer the data received ; 4(R5) address of maximum integer number of words to be received ; ; arguments beyond the second one depend on the call: ; ; IRCVDC: ; 6(R5) address of assembly language completion routine to ; be entered when the request completes ; ; MRCVD, MRCVDW: ; 6(R5) address of string specifying the data buffer address space ; ; MRCVDC: ; 6(R5) address of assembly language completion routine to ; be entered when the request completes ; 10(R5) address of string specifying the data buffer address space ; 12(R5) address of string specifying the completion routine ; address space ; ; OUTPUT PARAMETERS: ; ; R0 Function return ; 0 normal return ; 1 no other job exists in the system ; -19. Invalid mode specified (M-form request) ; ; Notes: ; o If entered from IRCVDF, R1 already contains address of ; completion routine ; ;- .PSECT SYS$I .ENABL LSB .IF EQ SYSL$X RCVD:: IRCVD:: .IFF ;EQ SYSL$X MRCVD:: .ENDC ;EQ SYSL$X MOV #1,R1 ;Set asynch flag (non-wait mode) BR $RCVD ; and join common code .IF EQ SYSL$X RCVDC:: IRCVDC:: .IFF ;EQ SYSL$X MRCVDC:: .ENDC ;EQ SYSL$X MOV #$NOARG,R1 ;Indicate completion routine required BR $RCVD ; and join common code .IF EQ SYSL$X RCVDW:: IRCVDW:: .IFF ;EQ SYSL$X MRCVDW:: .ENDC ;EQ SYSL$X CLR R1 ;Reset asynch flag (wait mode) .BR $RCVD ; and join common code .IF EQ SYSL$X $RCVD:: .IFF ;EQ SYSL$X $RCVD: .ENDC ;EQ SYSL$X MOV (R5)+,R4 ;R4 (low byte) contains argument count SUB #L.RCVU,SP ;Make room on stack for EMT area MOV SP,R2 ;R2 -> Buffer in EMT area ADD #A.BUF,R2 ; ... ; Arguments are in an order which permit loading of the EMT area ; in forward order beginning with the buffer address CALL $NXADR ;Get buffer address BCS ERR ;Argument is required... MOV R0,(R2)+ ;Move to EMT area CALL $NXVAL ;Get word count BCS ERR ;Another required argument... MOV R0,(R2)+ ;Move to EMT area CMP R1,#$NOARG ;Completion routine required? BNE 10$ ;Nope... CALL $NXADR ;Yes, get its address BCS ERR ;Argument is required... MOV R0,R1 ;R1 -> Completion routine 10$: .IF NE SYSL$X CALL $BCMOD ;Handle BMODE and CMODE arguments BCS 20$ ;Invalid mode specified, ; error code (-19.) in R0 MOV (SP)+,R2 ;R2 = Buffer mapping mask .IFF ;NE SYSL$X .RCVDC SP,CRTN=R1 ;Perform the I-form request .IFT ;NE SYSL$X .RCVDC SP,CRTN=R1,BMODE=*BYPASS*,CMODE=R2 ;Perform the M-form request .ENDC ;NE SYSL$X CALL $ERRP0 ;Perform EMT error conversion 20$: ADD #L.RCVU,SP ;Dump the EMT area RETURN ERR: TRAP $MSARG ;Report missing arguments RETURN .DSABL LSB .END