.TITLE TRMCOM.MAC 88e26a 09-APR-81/26-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 09-APR-81/26-May-88. ;09-APR-81 ORIGINAL CREATION. ;14-APR-81 ADDED STATEMENT ABOUT REENTRANT CODE TO DESCRIPTION. ;23-JUL-81 CORRECTED AN ADDRESSING ERROR IN THE SUPPORTING ; SUBROUTINES. ADDED THE "DOIT2" SUBROUTINE. ;26-FEB-82 ADDED IDENTIFICATION CODE. ;06-Jan-84 Maintenance assumed by NAB Software Services, Inc. ;04-Oct-84 Minor revisions for V5.1. ;26-Feb-86 Revised for V6.0. Changed the TRMMSG routine ; description. Changed the DOIT2 subroutine to ; return error information. ;26-Mar-87 Revised for V6.2. Added NAB Software disclaimer. ; Added description and code for IYELL routine. ; Revised DOIT2 subroutine. ;23-Sep-87 Corrected bug in TRMMSG routine. ;26-May-88 Revised for V6.31. Added ITRYMS and IRTYEL. .PAGE .SBTTL DESCRIPTION 09-APR-81/26-Mar-87. ;THESE TERMINAL COMMUNICATION SUPPORT ROUTINES ARE CALLABLE AS ;SUBROUTINES. THIS MODULE IS A PART OF THE LIBRARY OF FORTRAN CALLABLE ;TSX/TSX-PLUS EMT ROUTINES. ;SEND A MESSAGE (STRING OF CHARACTERS) TO ANOTHER TERMINAL (LINE). ; ;CALLING SEQUENCEs: ; ; CALL TRMMSG ( ILINE , CHRSTR [ , IERR ] ) ; or ; IERR = TRMMSG ( ILINE , CHRSTR ) ; ; where: ILINE is the line number of the terminal to which the ; message is to be sent. ; ; CHRSTR is the name of the buffer that contains the ; message. ; ; IERR is negative or one of the following: ; ; 0 job does not have SEND privilege. ; ; 1 receiving line is SET TT GAG. ;Override the SET TT GAG command option. ; ;Calling sequences: ; ; CALL IYELL ( ILINE , CHRSTR [ , IERR ] ) ; or ; IERR = IYELL ( ILINE , CHRSTR ) ; ; where: ILINE is the line number of the terminal to which the ; message is to be sent. ; ; CHRSTR is the name of the buffer that contains the ; message. ; ; IERR is negative or one of the following: ; ; 0 job does not have SEND privilege. ; ; 1 receiving line is SET TT GAG. ; Try to send a message to another line. ; ; Calling sequences: ; ; CALL ITRYMS ( ILINE,CHRSTR [ ,IERR ] ) ; or ; IERR = ITRYMS ( ILINE,CHRSTR ) ; ; where: ILINE is the line number of the terminal to which ; the message is to be sent. ; ; CHRSTR is the name of the buffer that contains the ; message. ; ; IERR is negative or one of the following: ; ; 0 the job does not have SEND privilege. ; ; 1 the line has SET TT GAG and is executing ; a program. ; ; 2 no free message buffers are available. ; Try to override the TT GAG option. ; ; Calling sequences: ; ; CALL ITRYEL ( ILINE,CHRSTR [ ,IERR ] ) ; or ; IERR = IRTYEL ( ILINE,CHRSTR ) ; ; where: ILINE is the line number of the terminal to which ; the message is to be sent. ; ; CHRSTR is the name of the buffer that contains the ; message. ; ; IERR is negative or one of the following: ; ; 0 the job does not have SEND privilege. ; ; 1 the line has SET TT GAG and is executing ; a program. ; ; 2 no free message buffers are available. ;SEND A STRING OF CHARACTERS TO THE TERMINAL. ; ;CALLING SEQUENCE: ; ; CALL TRMOUT ( CHRSTR , ICOUNT ) ; ; where: CHRSTR is the name of the buffer containing the ; character string. ; ; ICOUNT is the number of characters in the string. ;ACCEPT A STRING OF CHARACTERS FROM THE TERMINAL. ; ;CALLING SEQUENCE: ; ; CALL TRMIN ( CHRBUF , IBFSIZ , ICOUNT [ , IERR ] ) ; ; WHERE: IERR IS ONE OF THE FOLLOWING: ; ; 0 NO ERROR. ; 1 BUFFER OVERFLOW. .PAGE .SBTTL DIRECTIVES 09-APR-81/26-May-88. .IDENT \88e26a\ ;TELL LINKER OUR VERSION .PSECT TSXLIB .GLOBL TSLBID .WORD TSLBID .DSABL GBL .SBTTL ASSIGNMENTS 26-Feb-86/. ERRBYT = 52 ;EMT error code location NOERR = -1 ;code for no error .PAGE .SBTTL ENTRY POINTS 09-APR-81/26-May-88. ;SEND A MESSAGE TO ANOTHER LINE. ; TRMMSG::MOV #127 ,R1 ;EMT CODE CLR R2 ;function code JSR PC ,DOIT2 ;SEND THE MESSAGE RTS PC ;Override the SET TT GAG command. ; IYELL:: MOV #127 ,R1 ;EMT code MOV #1 ,R2 ;function code CALL DOIT2 ;override the command RETURN ; Try to send a message to another line. ; ITRYMS::MOV #127 ,R1 ;EMT code MOV #2 ,R2 ;function code CALL DOIT2 ;try to send the message RETURN ;Try to override the SET TT GAG command. ; ITRYEL::MOV #127 ,R1 ;EMT code MOV #3 ,R2 ;function code CALL DOIT2 ;try to override RETURN ;SEND A STRING OF CHARACTERS TO THE TERMINAL. ; TRMOUT::MOV #114 ,R1 ;EMT CODE JSR PC ,DOIT ;SEND THE STRING RTS PC ;ACCEPT A STRING OF CHARACTERS FROM THE TERMINAL. ; TRMIN:: MOV #115 ,R1 ;EMT CODE JSR PC ,DOIT1 ;ACCEPT THE STRING RTS PC .PAGE .SBTTL SUPPORTING SUBROUTINES 09-APR-81/26-Mar-87. DOIT: MOV @4(R5) ,-(SP) ;PASS ARGUMENT 2 MOV 2(R5) ,-(SP) ;PASS ARGUMENT 1 CLR -(SP) ;LO BYTE = 0 MOV SP ,R0 ;SET UP THE POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE EMT 375 ;LET TSX DO IT ADD #6 ,SP ;FIX THE STACK POINTER RTS PC DOIT1: MOV @4(R5) ,-(SP) ;PASS ARGUMENT 2 MOV 2(R5) ,-(SP) ;PASS ARGUMENT 1 CLR -(SP) ;LO BYTE = 0 MOV SP ,R0 ;SET UP THE POINTER MOVB R1 ,1(R0) ;HI BYTE = EMT CODE CLR R1 ;FOR ERROR CODE EMT 375 ;LET TSX DO IT BCC 1$ ; IF NO ERROR INC R1 ; IF ERROR 1$: MOV R0 ,@6(R5) ;RETURN ARGUMENT 3 CMPB #4 ,(R5) ;SUBROUTINE ERROR RETURN? BNE 2$ ; NO MOV R1 ,@10(R5) ; YES 2$: ADD #6 ,SP ;FIX THE STACK POINTER RTS PC DOIT2: 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 error code 1$: CMPB #3 ,(R5) ;subroutine error return? BNE 2$ ; no MOV R1 ,@6(R5) ; yes 2$: MOV R1 ,R0 ;function error return ADD #6 ,SP ;FIX THE STACK POINTER RTS PC .SBTTL END 09-APR-81/. .END