.MCALL .MODULE .MODULE IWRITF,06,COMMENT=,IDENT=NO,LIB=YES,GLOBAL=.WRITF ; 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: ; ; IWRITF ; ; 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 .WRITC ; .WRITC programmed request ; ; EXTERNAL REFERENCES: ; .GLOBL $SYSLB ; Include system library work area. .GLOBL $ERRM0 ; Entry point to EMT error conver rtn .GLOBL $NOARG ; Missing argument code .GLOBL $CMPLT ; Entry point to set-up linkage to FORTRAN .GLOBL $WRITE ; Entry point to commn IWRITE code .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 IWRITF - Fortran-callable routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; IWRITF - transfers a specified number of words from memory the ; to the specified channel. Control returns to the user ; program immediately after the request is queued. When the ; transfer is complete, the specified FORTRAN language ; routine is entered as an asynchronous completion routine. ; ; ; CALLING SEQUENCE: ; ; I = IWRITF( wcnt, buff, blk, chan, area, crtn ) ; ; ; INPUT PARAMETERS: ; ; R5 - address of IWRITE/IWRITW/IWRITC argument block ; 0(R5) - argument count ; 2(R5) - address of the number of words to be written ; 4(R5) - address of the buffer to be used for output ; 6(R5) - address of the block number to be written ; 10(R5) - address of a channel number ; 12(R5) - address of four-word area to be set aside for link ; information ; 14(R5) - address of the user's FORTRAN completion routine ; ; OUTPUT PARAMETERS: ; ; R0 - function status ; ; ROUTINE VALUE: ; ; I = N Normal return, n= # words being write ; = -1 Attempt to write past end-of-file ; = -2 Hard error occurred on channel ; = -3 Channel is not open ; ; MODIFICATION HISTORY: ; ; 13-APR-1997 Tim Shoppa ; IWRITF was badly broken in 5.6 when IWRITE.MAC was ; "upgraded" to mapped environment operation. The entry ; point $WRITE:: in IWRITE.MAC is now useless for IWRITF's ; purposes. So now IWRITF no longer calls common code ; in IWRITE - instead, it is all self contained ;-- ; .PSECT SYS$I WRITF:: IWRITF::CMPB #6,@R5 ; all arg present ? BNE ERR ; no, then ERR ADD #12,R5 ; R5 -> addr of area CMP #$NOARG,@R5 ; missing AREA ? BEQ ERR CMP #$NOARG,2(R5) ; missing CRTN ? BEQ ERR ; yes, then ERR MOV (R5)+,R1 ; R1 -> area MOV R1,-(SP) ; set complt routine addr CALL $CMPLT ; SUB #14,R5 ; back to beginning of arg blk MOV SP,R1 TST (R1)+ ; save orginal stack pntr MOV (R5)+,R4 ; R4 (low byte) contains arg count CALL $NXVAL ; get WCNT BCS ERR ; WCNT missing then err MOV R0,-(SP) ; store WCNT on stack CALL $NXADR ; get BUFF BCS ERR ; BUFF missing then err MOV R0,-(SP) ; store BUFF on stack CALL $NXVAL ; get BLK number BCS ERR ; BLK missing then err MOV R0,-(SP) ; store BLK on stack CALL $NXVAL ; get CHAN BCS ERR ; CHAN missing then err MOV R0,-(SP) ; store CHAN on stack .WRITC SP MOV R1,SP ;*c* restore stack 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 ERR1: TRAP $MSARG ; handle any missing argument in call RTRN: RETURN .END