.TITLE SUBPRO.MAC 88j20a 06-Apr-87/20-Oct-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. .SBTTL EDIT RECORD 06-Apr-87/20-Oct-88. ;07-Apr-87 Original creation. ;20-Oct-88 Revised DOIT routine per information furnished by ; K. P. Schneider, Perkin-Elmer Censor, Vaduz, ; Lietchenstein. .PAGE .SBTTL DESCRIPTION 06-Apr-87/07-Apr-87. ; This module contains the subprocess control routines. The module ; is a part of the library of FORTRAN callable TSX-Plus EMT support ; routines. ; Initialize a new or switch to an existing subprocess. ; ; Calling sequence: ; ; CALL INITSP ( ISPN, IRPN, 0, CMDFIL, IRET [, IERR ] ) ; ; ; Try to initialize a new subprocess. ; ; Calling sequence: ; ; CALL ITRYSP ( ISPN, IRPN, INITO, CMDFIL, IRET [, IERR ] ) ; ; ; Switch to an existing subprocess. ; ; Calling sequence; ; ; CALL ISWESP ( ISPN, 0, 0, 0, IRET [, IERR ] ) ; ; ; where: ISPN is the desired subprocess number. ; ; IRPN is the process to be returned to when the ; process initiated by this routine terminates. ; ; INITO controls whether the terminal connection is ; switched to the subprocess as follows: ; ; 0 terminal control is switched to the ; subprocess. ; ; 1 terminal control remains with the ; current process. ; ; CMDFIL is the name of the string variable containing ; the file specification of a command file to be ; executed when the subprocess is initiated. ; ; IRET If ISPN is too large, the TSGEN parameter ; MAXSEC is returned. If ISPN was -1, the ; number of the subprocess initiated is returned. ; ; IERR is negative or one of the following: ; ; 1 You are not authorized to use subprocesses. ; ; 2 The specified subprocess number is too ; large. ; ; 3 All of your subprocesses are already ; active. ; ; 4 Insufficient memory space available for ; process. ; ; 5 Specified subprocess has already been ; initiated. ; ; 6 Specifies subprocess has not been initiated. .PAGE .SBTTL DIRECTIVES 06-Apr-87/20-Oct-88. .IDENT \88j20a\ ;tell linker our version .PSECT TSXLIB,I .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 06-Apr-87/. ERRBYT = 52 ;EMT error code location NOERR = -1 ;code for no error condition .PAGE .SBTTL ENTRY POINTS 06-Apr-87/. ; Initialize a new or switch to an existing subprocess. ; INITSP::MOV #162 ,R1 ;EMT code CLR R2 ;sub-function code CALL DOIT ;init or switch RETURN ; Try to initialize a new subprocess. ; ITRYSP::MOV #162 ,R1 ;EMT code MOV #1 ,R2 ;sub-function code CALL DOIT ;init the subprocess RETURN ; Switch to an existing subprocess. ; ISWESP::MOV #162 ,R1 ;EMT code MOV #2 ,R2 ;sub-function code CALL DOIT ;switch to the subprocess RETURN .PAGE .SBTTL SUPPORTING SUBROUTINES 06-Apr-87/20-Oct-88. DOIT: CLR -(SP) ;nul argument MOV 10(R5) ,-(SP) ;pass argument 4 MOV @4(R5) ,-(SP) ;lo byte = argument 2 MOV SP ,R0 ;set pointer MOVB @6(R5) ,1(R0) ;hi byte = argument 3 MOV @2(R5) ,-(SP) ;lo byte = argument 1 MOV SP ,R0 ;set pointer CLRB 1(R0) ;hi byte = nul argument MOV R2 ,-(SP) ;lo byte = sub-function code MOV SP ,R0 ;set pointer MOVB R1 ,1(R0) ;hi byte = EMT code MOV #NOERR ,R1 ;code for no error EMT 375 ;let TSX do it MOV R0 ,@12(R5) ;return argument 5 BCC 1$ ; if no error CLR R1 ; if error, then MOVB @#ERRBYT,R1 ; get the code 1$: CMPB #6 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@14(R5) ; yes 2$: MOV R1 ,R0 ;function error return ADD #12 ,SP ;fix the stack pointer RETURN .SBTTL END 06-Apr-87/. .END