.TITLE SPOLER.MAC 89e11a 17-SEP-80/11-May-89. .ENABL LC ; Author: N. A. Bourgeois, Jr. ; NAB Software Services, Inc. ; PO Box 20009 ; Albuquerque, NM 87154 ; The code and information in this software is subject to ; change without notice and should not be construed as a ; commitment by NAB Software Services, Inc. NAB Software ; Services,Inc. assumes no responsibility for any errors ; that may appear in this software. ; ; ; NOTICE ; ; This software is sponsored by NAB Software Services, Inc. ; Neither NAB Software Services, Inc., nor any of their ; employees, nor any of their contractors, subcontractors, ; or their employees makes any warranty, express or implied, ; or assumes any legal liability or responsibility for the ; accuracy, completeness or usefulness of any information, ; apparatus, product or process disclosed, or represents ; that its use would not infringe privately owned rights. ; THIS SOFTWARE WAS ORIGINALLY ISSUED BY SANDIA NATIONAL ; LABORATORIES, OPERATED FOR THE UNITED STATES DEPARTMENT ; OF ENERGY BY SANDIA CORPORATION. ; ; NOTICE ; ; THIS SOFTWARE WAS ORIGINALLY SPONSORED BY THE UNITED ; STATES GOVERNMENT. NEITHER THE UNITED STATES GOVERNMENT ; NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF ; THEIR EMPLOYEES, NOR ANY OF THEIR CONTRACTORS, ; SUBCONTRACTORS, OR THEIR EMPLOYEES MAKES ANY WARRANTY, ; EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL LIABILITY OR ; RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS OR ; USEFULNESS OF ANY INFORMATION, APPARATUS, PRODUCT OR ; PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT ; INFRINGE PRIVATELY OWNED RIGHTS. ; ; THIS WORK WAS ORIGINALLY FUNDED BY: ; ; HEADQUARTERS, ESD / OCB / STOP 36 ; HANSCOM AIR FORCE BASE, MA 01731 .SBTTL EDIT RECORD 17-SEP-80/11-May-89. ;17-SEP-80 ORIGINAL CREATION. ;18-SEP-80 ADDED GLOBAL TO LOCATE DATA IN LINK MAP. ;10-OCT-80 CHANGED TITLE, REVISED AND ADDED ISPBLK. ;25-MAR-81 CORRECTED ADDRESSING ERROR. CORRECTED EMT # ERRORS. ;08-APR-81 ADDED THE "MEMSET" AND ITSLIC" ROUTINES. RENAMED ; "TSXTST" TO "ITSLIN". ADDED FUNCTION CALLING CODE. ; MADE CODE REENTRANT. ;14-APR-81 ADDED STATEMENT ABOUT REENTRANT CODE TO DESCRIPTION. ;26-FEB-82 ADDED IDENTIFICATION CODE. ;06-Jan-84 Maintenance assumed by NAB Software Services, Inc. ;28-Jan-84 Added the IFLINF, ISTFTM, GTUNAM, STUNAM, ISTPRV, ; ISPCTL, DOIT2, DOIT3, and DOIT4 routines. ;31-Jul-84 Corrected stack error in DOIT2, DOIT3, and DOIT4 ; routines. ;03-Oct-84 Converted from TSXLIB.MAC. Minor revisions for V5.1. ;26-Mar-87 Revised for V6.2. Added NAB Software disclaimer. ;09-Feb-88 Fixed bug in DOIT for F77. ;11-May-89 Revised for V6.40a. Added ISPUSE, ISPFLP, and ISPFLC ; routines. Changed ISPBLK, ISPCTL, DOIT, and DOIT4 ; routines. .PAGE .SBTTL DESCRIPTION 17-SEP-80/11-May-89. ; This module contains the spooler support routines. The module is ; a part of the library of FORTRAN callable TSX-Plus EMT support ; routines. The code is reentrant. ;THE "ISPBLK" ROUTINE RETURNS THE INTEGER VALUE OF THE NUMBER OF FREE ;BLOCKS IN THE SPOOL FILE. ; ;CALLING SEQUENCES: ; ; CALL ISPBLK ( IRET ) ; OR ; IRET = ISPBLK () ; ; where: IRET is the number of free blocks in the spool ; file. ; The ISPUSE routine returns the integer value of the number of blocks ; used in the spool file. ; ; Calling sequences: ; ; CALL ISPUSE ( IRET ) ; or ; IRET = ISPUSE () ; ; where: IRET is the number of blocks currently used in the ; spool file. ; Control the release time of a spooled file. ; ; Calling sequences: ; ; CALL ISPCTL ( ICHAN,IFLAG [ ,IRET ] ) ; or ; IRET = ISPCTL ( ICHAN,IFLAG ) ; ; where: ICHAN is the number of the channel that is open to ; the file. ; ; IFLAG is an integer value as follows: ; ; 0 Release the file immediately. ; ; 1 Hold the release until the file is ; closed. ; ; IRET is an integer value returned with the following ; values: ; ; <0 The device is either not spooled or it ; was not found. ; ; 0 The previous spooler mode was nohold. ; ; >0 The previous spooler mode was hold. ; The ISPFLP controls the presence or absence of a flag page preceeding ; the the output of the spooled file. ; ; Calling sequences: ; ; CALL ISPFLP ( ICHAN,IFLAG [ ,IRET ] ) ; or ; IRET = ISPFLP ( ICHAN,IFLAG ) ; ; where: ICHAN is the number of the channel that is open to ; the file. ; ; IFLAG is an integer value as follows: ; ; 0 Disable flag pages. ; ; 1 Enable flag pages. ; ; IRET is the returned integer value as follows: ; ; <0 The device is either not spooled or it ; was not found. ; ; 0 The previous mode was noflag. ; ; >0 The previous mode was flag. ; The ISPFLC controls the centering of the flag page on either 80 or ; 132 columns. ; ; Calling sequences: ; ; CALL ISPFLC ( ICHAN,IFLAG [ ,IRET ] ) ; or ; IRET = ISPFLC ( ICHAN,IFLAG ) ; ; where: ICHAN is the number of the channel that is open to ; the file. ; ; IFLAG is an integer value as follows: ; ; 0 Center on 80 columns. ; ; 1 Center on 132 columns. ; ; IRET is the returned integer value as follows: ; ; <0 The device is either not spooled or it ; was not found. ; ; 0 The previous mode was to center on 80 ; columns. ; ; 1 The previous mode was to center on 132 ; columns. .PAGE .SBTTL DIRECTIVES 17-SEP-80/11-May-89. .IDENT \89e11a\ ;TELL LINKER OUR VERSION .PSECT TSXLIB,I .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 28-Jan-84/. ERRBYT = 52 ;EMT error code locationn NOERR = -1 ;code for no error condition .PAGE .SBTTL ENTRY POINTS 17-SEP-80/11-May-89. ;DETERMINE THE NUMBER OF FREE BLOCKS IN THE SPOOL FILE. ; ISPBLK::MOV #107 ,R1 ;EMT CODE CLR R2 ;EMI id JSR PC ,DOIT ;GET THE NUMBER OF BLOCKS RTS PC ; Determine the number of blocks used in the spool file. ; ISPUSE::MOV #107 ,R1 ;EMT code MOV #1 ,R2 ;EMT id CALL DOIT ;get the number of blocks RETURN ; Control the release time of a spooled file. ; ISPCTL::MOV #151 ,R1 ;EMT code CLR R2 ;EMI id CALL DOIT4 ;control the release RETURN ; Control the use of flag pages. ; ISPFLP::MOV #151 ,R1 ;EMT code MOV #1 ,R2 ;EMT id CALL DOIT4 ;control flag pages RETURN ; Control the centering of flag pages. ; ISPFLC::MOV #151 ,R1 ;EMT code MOV #2 ,R2 ;EMT id CALL DOIT4 ;control the centering RETURN .PAGE .SBTTL SUPPORTING SUBROUTINES 17-SEP-80/11-MAY-89. DOIT: MOV R2 ,-(SP) ;LO BYTE = EMT id MOV SP ,R0 ;SET UP THE POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE EMT 375 ;LET TSX DO IT BCC 1$ ; IF NO ERROR CLR R0 ; RETURN ZERO ON ERROR 1$: TSTB (R5) ;F66 function call? BEQ 2$ ; yes CMP 2(R5) ,#-1 ; F77 function call? BEQ 2$ ; yes MOV R0 ,@2(R5) ; NO, SUBROUTINE CALL 2$: TST (SP)+ ;FIX THE STACK POINTER RTS PC DOIT4: MOV @4(R5) ,-(SP) ;pass argument 2 value MOV @2(R5) ,-(SP) ;pass argument 1 value MOV R2 ,-(SP) ;lo byte = EMT id MOV SP ,R0 ;set up the EMT pointer MOVB R1 ,1(R0) ;hi byte = EMT code EMT 375 ;let TSX do it BCC 1$ ; if no error MOV #-1 ,R0 ; if error 1$: CMPB #3 ,(R5) ;function call? BNE 2$ ; yes MOV R0 ,@6(R5) ; no, subroutine call 2$: ADD #6 ,SP ;fix the stack pointer RETURN .SBTTL END 17-SEP-80/. .END