.TITLE PHOWRT - WRITE TO THE TERMINALS .IDENT /1.1/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided ; or otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: PHOWRT.MAC ; Author: Gary N. Larsen ; Date: August 3, 1982 ; ; Description: ; ; Writes the PHONE message to the terminals. ; ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL GLUN$S, PUT$, QIOW$S, QIO$S .MCALL UCBDF$ UCBDF$ ; DEFINE UCB OFFSETS AND BITS ; Local/global storage area: LUN:: .WORD 0 ; CURRENT LUN FOR QIOW$ EFN:: .WORD 0 ; AND THE EFN TTYST: .BYTE TC.TTP ; GET TERMINAL TYPE TTYPE: .BYTE 0 ; INITIALIZE TO VT100 TTYSIZ = .-TTYST ; SIZE OF STATUS TABLE .SBTTL WRTMSG - CALCULATE COUNT AND WRITE MESSAGE ;+ ; ; WRTMSG - Calculate the byte count and write the message. ; ; Inputs: ; BUFPTR = the updated output buffer address. ; ; Outputs: ; BUFPTR = starting address of message buffer. ; ; All registers are preserved. ; ;- WRTMSG::JSR R2,$SAVVR ; SAVE R0 - R2 CALL SETBUF ; SET THE BUFFER AND COUNT MOV R1,BUFPTR ; RESET THE BUFFER POINTER TST R2 ; IS THERE A BYTE COUNT ? BEQ 10$ ; IF EQ, DON'T SKIP WRITE CALL WRITIT ; WRITE IT TO THE TERMINAL 10$: RETURN .SBTTL WRITIT - WRITE THE MESSAGE TO THE TERMINAL ;+ ; ; WRITIT - Write the message to the terminal. ; ; Inputs: ; R1 = the buffer address. ; R2 = the buffer byte count. ; ; Outputs: ; Carry clear/set = success/failure. ; ; All registers are preserved. ; ;- WRITIT::CALL DOQIO ; DO A QIO TO THE TERMINAL RETURN .SBTTL SETBUF - SET BUFFER AND BYTE COUNT ;+ ; ; SETBUF - Set the buffer address and byte count. ; ; Inputs: ; BUFPTR = the updated message buffer pointer. ; ; Outputs: ; R1 = the message buffer address. ; R2 = the buffer byte count. ;- SETBUF:: MOV #MSGBUF,R1 ; SET THE BUFFER ADDRESS MOV BUFPTR,R2 ; COPY UPDATED BUFFER POINTER SUB R1,R2 ; CALCULATE THE BYTE COUNT RETURN .SBTTL CHKTTY - CHECK THE TERMINAL TO DIAL ;+ ; ; CHKTTY - Check the terminal to dial. ; ; This routine checks the terminal being dialed for a VT100 terminal ; and logged on. It would also check for /NOBROADCAST is that information ; was available but it can only be accessed if mapped to the Executive. ; Bit UM.NBR = 1 in offset U.MUP in the UCB for nobroadcast. ; ; Inputs: ; LUN and EFN of terminal to check. ; ; Outputs: ; C bit clear/set = terminal OK/not OK. ; ;- .ENABL LSB CHKTTY::JSR R2,$SAVVR ; SAVE R0 - R2 CALL CHKVT1 ; IS THIS A VT100 TERMINAL ? BCS 10$ ; IF CS, NO GLUN$S LUN,#LUNBUF ; GET THE LUN INFORMATION CALL CHKDIR ; CHECK/REPORT DIRECTIVE ERROR BCS 10$ ; IF CS, FAILURE ; C BIT IS CLEAR FOR NEXT "BIT" BIT #U2.LOG,LUNBUF+G.LUCW+2 ; IS THIS TERMINAL LOGGED ON ? BEQ 10$ ; IF EQ, YES (SUCCESS) ERRMSG NOLOGM, SEC ; SHOW FAILURE 10$: RETURN .DSABL LSB .SBTTL CHKVT1 - CHECK FOR VT100 FAMILY TERMINAL ;+ ; ; CHKVT1 - Check for VT100 family Terminal. ; ; Inputs: ; LUN and EFN must be preset. ; ; Outputs: ; Carry bit clear/set = success/failure. ; ; All registers are preserved. ; ;- .ENABL LSB CHKVT1::QIOW$S #SF.GMC,LUN,EFN,,,,<#TTYST,#TTYSIZ> CALL CHKDIR ; CHECK FOR ERRORS BCS 90$ ; IF CS, ERROR CMPB TTYPE,#T.V100 ; ARE WE ON A VT100 ? BEQ 100$ ; IF EQ, YES ; Range of VT100 terminals is T.V101 (24) through T.V132 (31). CMPB TTYPE,#T.V101 ; Is this possible VT100 family ? BLO 10$ ; If LO, no CMPB TTYPE,#T.V132 ; Really a VT100 family terminal ? BLOS 100$ ; IF LOS, yes 10$: ERRMSG NVT100, 90$: SEC ; RETURN FAILURE STATUS RETURN 100$: CLC ; RETURN SUCCESS RETURN .DSABL LSB .SBTTL DOQIO - DO A QIO TO THE LOCAL TERMINAL ;+ ; ; DOQIO - Do a QIO to a terminal local terminal. ; ; Inputs: ; R1 = the buffer addres ; R2 = the buffer byte count. ; ; Outputs: ; Carry bit clear/set = success/failure. ; ; All registers are preserved. ; ;- DOQIO:: QIOW$S #IO.WAL,#OULUN,#OUEFN,,,, CALL CHKDIR ; CHECK/REPORT ANY ERRORS RETURN .SBTTL SCRMSG - OUTPUT PHONE FORMAT TO SCREEN ;+ ; ; SCRMSG - Output phone format to screen. ; ; Inputs: ; SCRBUF = The address of the phone screen. ; SCRCNT = The byte count of the screen. ; ; Outputs: ; All registers are preserved. ; ;- SCRMSG::JSR R2,$SAVVR ; SAVE R0 - R2 MOV #SCRBUF,R1 ; SET THE BUFFER ADDRESS MOV SCRCNT,R2 ; COPY THE BYTE COUNT CALL DOQIO ; WRITE IT TO THE TERMINAL BIT #B.ANS,STATUS ; HAS THE PHONE BEEN ANSWERED ? BEQ 10$ ; IF EQ, NO CALL WRITTO ; UPDATE THE PHONED TERMINAL 10$: RETURN .END