.TITLE DETJBS.MAC 88e25a 10-APR-81/25-May-88. .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 10-APR-81/25-May-88. ;10-APR-81 ORIGINAL CREATION. ;14-APR-81 "ERRBYT" WAS 53. ;27-JUL-81 CORRECTED ADDRESSING ERROR IN THE "DOIT" SUBROUTINE. ;26-FEB-82 ADDED IDENTIFICATION CODE. ;06-Jan-84 Maintenance assumed by NAB Software Services, Inc. ;03-Oct-84 Code was formerly declared reentrant. ;25-Feb-86 Revised for V6.0. Modified the KLDTJB and STDTJB ; descriptions. Modified the DOIT and DOIT1 subroutines. ;24-Mar-87 Revised for V6.2. Added NAB Software Services disclaimer. ; Corrected error in DOIT subroutine. ;25-May-88 Revised for V6.31. Added KILJOB entry point to KLDTJB. .PAGE .SBTTL DESCRIPTION 10-APR-81/25-May-88. ; This module contains the detached job support routines. The module ; is a part of the library of FORTRAN callable TSX-Plus EMT support ; routines. ; START A DETACHED JOB. ; ; CALLING SEQUENCE: ; ; CALL STDTJB ( JOBNAM , JOBNUM [ , IERR ] ) ; ; WHERE: JOBNAM IS THE ASCII STRING, DEV:FILNAM.EXT, ; TERMINATED BY A NULL BYTE. ; ; JOBNUM IS THE RETURNED JOB NUMBER. ; ; IERR IS negative or THE FOLLOWING: ; ; 1 NO DETACHED JOB LINE AVAILABLE. ; Kill any job. ; ; Calling sequences: ; ; CALL KILJOB ( JOBNUM [ ,IERR ] ) ; or ; IERR = KILJOB ( JOBNUM ) ; ; where: JOBNUM is the number of the job to be killed. ; ; IERR is negative or one of the following: ; ; 1 invalid job number. ; ; 2 not privileged to kill named job. ; KILL A DETACHED JOB. ; ; CALLING SEQUENCES: ; ; CALL KLDTJB ( JOBNUM , [ , IERR ] ) ; OR ; IERR = KLDTJB ( JOBNUM ) ; ; WHERE: JOBNUM is the number of the detached job to be killed. ; ; IERR IS negative or THE FOLLOWING: ; ; 1 INVALID JOB NUMBER ; ; 2 not privileged to kill the named detached ; job. ; CHECK THE STATUS OF A DETACHED JOB. ; ; CALLING SEQUENCES: ; ; CALL ISTDJ ( JOBNUM , ISTAT ) ; OR ; ISTAT = ISTDJ ( JOBNUM ) ; ; WHERE: ISTAT IS ONE OF THE FOLLOWING: ; ; 0 JOB IS NOT ACTIVE. ; 1 JOB IS ACTIVE. .PAGE .SBTTL DIRECTIVES 10-APR-81/25-May-88. .IDENT \88e25a\ ;TELL LINKER OUR VERSION .PSECT TSXLIB .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 10-APR-81/25-Feb-86. ERRBYT = 52 ;ERROR CODE LOCATION NOERR = -1 ;return code for no error .PAGE .SBTTL ENTRY POINTS 10-APR-81/25-May-88. ;START A DETACHED JOB ; STDTJB::MOV #132 ,R1 ;EMT CODE CLR R2 ;EMT ID JSR PC ,DOIT ;START THE JOB RTS PC ; Kill any job. KILL A DETACHED JOB ; KILJOB:: KLDTJB::MOV #132 ,R1 ;EMT CODE MOV #2 ,R2 ;EMT ID JSR PC ,DOIT1 ;KILL THE JOB RTS PC ;CHECK THE STATUS OF A DETACHED JOB ; ISTDJ:: MOV #132 ,R1 ;EMT CODE MOV #1 ,R2 ;EMT ID JSR PC ,DOIT2 ;CHECK THE STATUS RTS PC .PAGE .SBTTL SUPPORTING SUBROUTINES 10-APR-81/24-Mar-87. DOIT: MOV 2(R5) ,-(SP) ;PASS ARGUMENT 1 MOV R2 ,-(SP) ;LO BYTE = EMT ID MOV SP ,R0 ;SET UP THE POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE MOV #NOERR ,R1 ;code for no error EMT 375 ;LET TSX DO IT BCC 1$ ; if no error CLR R1 ; if error, MOVB @#ERRBYT,R1 ; get the code 1$: MOV R0 ,@4(R5) ;RETURN ARGUMENT 2 CMPB #3 ,(R5) ;SUBROUTINE ERROR RETURN? BNE 2$ ; NO MOV R1 ,@6(R5) ; yes 2$: MOV R1 ,R0 ;function error return CMP (SP)+ ,(SP)+ ;FIX THE STACK POINTER RTS PC DOIT1: MOV @2(R5) ,-(SP) ;PASS ARGUMENT 1 MOV R2 ,-(SP) ;Lo BYTE = EMT ID MOV SP ,R0 ;SET UP THE POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE MOV #NOERR ,R1 ;code for no error EMT 375 ;LET TSX DO IT BCC 1$ ; if no error CLR R1 ; if error, MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #2 ,(R5) ;SUBROUTINE ERROR RETURN? BNE 2$ ; NO MOV R1 ,@4(R5) ; YES 2$: MOV R1 ,R0 ;function error return CMP (SP)+ ,(SP)+ ;FIX THE STACK POINTER RTS PC DOIT2: MOV @2(R5) ,-(SP) ;PASS ARGUMENT 1 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 ACTIVE CLR R0 ; IF NOT ACTIVE BR 2$ 1$: MOV #1 ,R0 ;SHOW ACTIVE 2$: CMPB #2 ,(R5) ;SUBROUTINE ARGUMENT RETURN? BNE 3$ ; NO MOV R0 ,@4(R5) ; YES 3$: CMP (SP)+ ,(SP)+ ;FIX THE STACK POINTER RTS PC .SBTTL END 10-APR-81/. .END