.MCALL .MODULE .MODULE ISPFNF,06,COMMENT=,IDENT=NO,LIB=YES,GLOBAL=.SPFNF ; 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: ; ; ISPFNF ; ; ENVIRONMENT: ; ; To use these functions, the handler must be in memory, and a ; channel must be associated with a file via a non-file-structured ; LOOKUP call. It uses "TRAP" to provide error processing. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .SPFUN ; SPFUN programmed request. ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRP0 ; Entry point to EMT error conver rtn .GLOBL $NXADR ; Entry point to next address routine .GLOBL $NXVAL ; Entry point to next value routine .GLOBL $SYSLB ; Include system library work area .GLOBL $NOARG ; Missing argument code .GLOBL $CMPLT ; Entry point to set-up linkage to a Fortran ; completion routine. .WEAK $MSARG ; Trap code for missing argument .SBTTL ISPFNF - Fortran-cllable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; ISPFNF is used in conjunction with special functions to various ; handlers. It provides a means of doing device dependent functions, ; such as rewind and backspace, to those devices. When the operation ; is complete, the specified FORTRAN routine(crtn) is entered as asyn- ; chronous completion routine. ; ; CALLING SEQUENCE: ; ; I = ISPFNF( code, chan, [wcnt, buff, blk,] area, crtn ) ; ; INPUT PARAMETERS: ; ; R5 - address of argument block ; ; 0(R5) - argument count of ISPFNF call ; 2(R5) - address of integer numeric code of the function to be performed ; 4(R5) - address of integer specification for RT-11 channel to be used ; 6(R5) - address of integer number of data words in the operation (default=0) ; 10(R5) - address of the array to be used as the data buffer ; 12(R5) - address of integer block number of the file to be operated upon ; 14(R5) - address of four-word area to be set aside for linkage information ; 16(R5) - address of a FORTRAN routine to be activated ; ; ; OUTPUT PARAMETERS: ; ; R0 - function call status ; ; ROUTINE VALUE: ; ; 0 - normal return ; 1 - attempt to read or write past end-of-file ; 2 - hardware error occured on channel ; 3 - channel specified is not open ; ; MODIFICATION HISTORY: ; ; 13-APR-1997 Tim Shoppa ; ISPFNF was badly broken in 5.6 when ISPFN.MAC was ; "upgraded" to mapped environment operation. The entry ; point $READ:: in ISPFN.MAC is now useless for ISPFNF's ; purposes. So now ISPFNF no longer calls common code ; in ISPFN - instead, it is all self-contained. ; ; -- .SBTTL ISPFNF - Fortran- callable Routine .PSECT SYS$I,I SPFNF:: ISPFNF::CMPB #7,@R5 ; all arg present ? BNE ERR2 ; no , then err ADD #14,R5 ; R5 -> addr of area CMP #$NOARG,@R5 ; missing AREA ? BEQ ERR2 ; yes, then err CMP #$NOARG,2(R5) ; missing CRTN ? BEQ ERR2 ; assume there are AREA and CRTN MOV (R5)+,R1 ; R1 -> AREA MOV R1,-(SP) ; set cmplt rtn addr CALL $CMPLT ; Set-up linkage to Fortran ISR; (parameters ; are passed both in R1 & R5). SUB #16,R5 ; back to beginning of arg blk MOV #2,R2 ; set flag for ISPFNF MOV SP,R1 ; TST (R1)+ ; save original stack pointer MOV (R5)+,R4 ; R4 (low byte) contains arg count CALL $NXVAL ; get CODE BCS ERR ; missing, then err MOV #377,-(SP) ; set special funct code MOVB R0,1(SP) ; store funct code CALL $NXVAL ; get chan number in R0 BCS ERR ; missing arg -> err MOV R0,R3 ; store chan number TST R2 ; is it ISPFNC/F BNE 2$ ; yes, then number of opt arg should = 3 TSTB R4 ; more arguments ? BEQ 12$ ; no, then perform SPFUN call 2$: SUB R2,R4 ; assume there is CRTN/AREA:CRTN for ISPFNC/F CMPB #3,R4 ; num of arg = 3 ? BNE ERR ; no, then -> err CALL $NXVAL ; get value of wcnt BCS 10$ ; if wcnt misng, buff and blk should be misng MOV R0,-(SP) ; store wcnt CALL $NXADR ; get value of buff BCS ERR MOV R0,-(SP) ; store buff CALL $NXVAL ; get value of blk BCS ERR MOV R0,-(SP) ; store blk BR 15$ 10$: CMP #$NOARG,(R5)+ ; buff missing ? BNE ERR ; no, then err CMP #$NOARG,(R5)+ ; blk missing ? BNE ERR ; no, then err 12$: clr -(sp) ; SET WCNT, BUF, BLK TO ZERO clr -(sp) clr -(sp) 15$: MOV R3,-(SP) ; store chan number .SPFUN SP,CRTN=<> ; MOV R1,SP ;*c* restore stack pntr CALLR $ERRP0 ; Get and convert any errors (status in R0). ERR: MOV R1,SP ; restore stack ERR2: TRAP $MSARG ; handle any missing arguments in call; RETURN .DSABL LSB .END