.TITLE JBSTMN.MAC 84j03a 03-Oct-84/. .ENABL LC ; Author: N. A. Bourgeois, Jr. ; of ; NAB Software Services, Inc. ; PO Box 20009 ; Albuquerque, NM 87154 ; and ; Sandia National Laboratories ; PO Box 5800 ; Albuquerque, NM 87185 .SBTTL EDIT RECORD 03-Oct-84/. ;03-Oct-84 Original creation. .PAGE .SBTTL DESCRIPTION 03-Oct-84/. ; This module contains the job status monitoring support routines. ; The module is a part of the library of FORTRAN callable TSX-Plus ; EMT support routines. ; The IESMCN routine establishes a job monitoring connection. ; ; Calling sequence: ; ; CALL IESMCN (JOBNUM,CPLRTN [ ,IERR ] ) ; or ; IERR = IESMCN (JOBNUM,CPLRTN) ; ; where: JOBNUM is the number of the job to be monitored. ; ; CPLRTN is the name of the completion routine to be ; entered when the status of the job changes. ; ; IERR is negative or one of the following: ; ; 1 Invalid job number. ; 2 No free job monitoring control blocks. ; The ICNMCN routine breaks or cancels a job monitoring connection. ; ; Calling sequence: ; ; CALL ICNMCN (JOBNUM [ ,IERR ] ) ; or ; IERR = ICNMCN (JOBNUM) ; ; where: JOBNUM is the number of th job for which job status ; monitoring is to be cancelled. If the job ; number is equal to 0, all job monitoring ; requests for the issuing job are cancelled. ; ; IERR is negative or the following: ; ; 1 Invalid job number. ; The IBSTCH routine broadcasts a job status change. ; ; Calling sequence: ; ; CALL IBSTCH (ISTVAL [ ,IERR ] ) ; or ; IERR = IBSTCH (ISTVAL) ; ; where: ISTVAL is the status value to be broadcast to all jobs ; that are monitoring the job making this call. ; ; IERR is negative or the following: ; ; 0 No jobs are monitoring the status of ; job making this call. .PAGE .SBTTL DIRECTIVES 03-Oct-84/. .IDENT \84j03a\ ;tell linker our version .PSECT TSXLIB,I .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 03-Oct-84/. ERRBYT = 52 ;EMT error code locationn NOERR = -1 ;code for no error condition .PAGE .SBTTL ENTRY POINTS 03-Oct-84/. ; Establish a job status monitoring connection. ; IESMCN::MOV #157 ,R1 ;EMT code CLR R2 ;function code CALL DOIT ;establish the connection RETURN ; Cancel a job status monitoring connection. ; ICNMCN::MOV #157 ,R1 ;EMT code MOV #1 ,R2 ;function code CALL DOIT1 ;cancel the connection RETURN ; Broadcast a job status change. ; IBSTCH::MOV #157 ,R1 ;EMT code MOV #1 ,R2 ;function code CALL DOIT1 ;broadcast the change RETURN .PAGE .SBTTL SUPPORTING ROUTINES 03-Oct-84/. DOIT: MOV 4(R5) ,-(SP) ;pass argument 2 MOV @2(R5) ,-(SP) ;pass argument 1 MOV R2 ,-(SP) ;lo byte = function code 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, then MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #3 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@6(R5) ; yes 2$: ADD #6 ,SP ;adjust the stack pointer RETURN DOIT1: MOV @2(R5) ,-(SP) ;pass the argument MOV R2 ,-(SP) ;lo byte = function code 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, then MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #2 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@4(R5) ; yes 2$: CMP (SP)+ ,(SP)+ ;adjust the stack pointer RETURN .SBTTL END 03-Oct-84/. .END