; NAME: BRDC25 ( originally BRDCST) ; ; FUNCTION: This program is used to "broadcast" a message to every ; terminal on the system. The restraints is uses in terminal ; selection are: 1) the terminal must be attached to a job, and ; 2) it must not be a PSEUDO terminal. The actual sending is done ; by opening the terminal as a file using the TRM: driver. ; ; AUTHOR: Tom Dahlquist (wrote BRDCST) ; Edit 5 creates BRDC25, which steals code from SEND25 by ; David Pallmann. This version sends the message to ; the status line (25) on Televideo 925/950 terminals. ; The escape sequence may have effects on other terminals ; which have not been verified. Mr. Pallmann's SEND25 checks ; to see that the term is in fact a 925/950; this code does ; not as of 07/31/86. eno ; HISTORY: ; DATE WHO SUBSTANCE ; 09/19/83 TAD Written. ; 07/16/84 TAD Was moving a blank into low memory, causing random ; failures. ; 06/85 John Baima ; Eisenbrauns ; PO Box 275 ; Winona Lake, IN 46590 ; Don't send messages to jobs running LPTSPL--they are printers. ; 07/03/86 Creed Erickson, Computer Systems Plus, Inc., Lancaster, Pa. ; a. Don't send to jobs spawned by MULTI. ; b. Don't send to TASK MANAGR slave jobs or TASK MANAGR itself. ; c. Add impure area to make reentrant. ; 07/31/86 Evan N. Oulashin, Portland Radio Supply, Portland, OR. ; Added status line stuff from SEND25 routine on AMUS, so ; broadcasts now go to line 25 (on TVI925/TVI950) - effects ; on other terminal types NOT CHECKED. ; SEARCH SYS SEARCH SYSSYM VMAJOR=1 VMINOR=0 VEDIT=5. ; 5 - eno DEFINE SEND INCHR MOVB INCHR,D1 FILOTB DDB(A4) ENDM BRDCST: PHDR -2,PV$RSM,PH$REU!PH$REE GETIMP MEMSIZ,A4 LIN ; anything to send? JEQ EXIT ; leave if not... MOVW #[TRM],DDB+D.DEV(A4) ; move in device name, INIT DDB(A4) ; and initialize. JOBIDX A0 ; A0 -> out JCB... PUSH A2 ; save A2... LEA A1,JOBNAM(A0) ; A1 -> job name field... LEA A2,JOB(A4) ; A2 -> job name work area... UNPACK ; unpack name into work area... UNPACK MOVB #32.,@A2 POP A2 MOV JOBTBL,A0 ; -> first JCB pointer... LOOP: MOV (A0)+,D7 ; -> JCB... BEQ LOOP ; if not allocated... CMP D7,#-1 ; test for end of table... JEQ EXIT ; leave if so... MOV D7,A1 ; ; test for task managr job just in case it's not using PSEUDO tdv ; CMM JOBNAM(A1),#[TAS]_16.+[K ] ; is job a TASK MANAGR? BEQ LOOP ; branch if so ; ; test for job spawned by MULTI to avoid sending to unreal terminal ; MOV JOBATT(A1),D7 ; get attached job BEQ 10$ ; if none then proceed CMP D7,A1 ; compare to this job BNE LOOP ; if not same then loop 10$: ; ; ignore spooler jobs and slaves to TASK MANAGR ; MOVW JOBTYP(A1),D7 ; get job type ANDW #,D7 ; mask off spooler and task bits BNE LOOP ; loop if either set ; next two lines removed in edit 4 ; CMM JOBPRG(A1),#[LPT]_16.+[SPL] ; JKB-Running Spooler ; BEQ LOOP ; br if this is a printer MOV JOBTRM(A1),D7 ; D7 -> TCB... BEQ LOOP ; br if no terminal... MOV D7,A5 ; A5 -> TCB... MOV 2(A5),A3 ; A3 -> interface driver... SUB #4,A3 ; A3 -> I.D. name... CMM @A3,PSEUDO ; PSEUDO? BEQ LOOP ; br if so... MOV -4(A5),D.FIL(A4) ; move in terminal name... OPENO DDB(A4) ; open for output SEND #7 ; ring the chime (moved and changed) SEND #27. ;enable (this from SEND25) SEND #'g ; status line SEND #27. ;program SEND #'f ; status line LEA A1,JOB(A4) ; A1 -> job name work area... SEND #'( ; parens are nicer NLOOP: MOVB (A1)+,D1 CMPB D1,#' ; a space BNE SENDIT ; don't send last space (eno) BR ENDPAR ; " SENDIT: FILOTB DDB(A4) BR NLOOP ENDPAR: SEND #') ; MOVB #45.,D1 ; used to add a - after jobname ; FILOTB DDB(A4) ; we now have added parens (eno) SEND #32. ; space PUSH A2 ; save -> text line... OLOOP: MOVB (A2)+,D1 ; get next byte of text and FILOTB DDB(A4) ; output... LIN ; end of input line? BNE OLOOP ; br if not, else POP A2 ; restore A2 and MOVB #15,D1 ; a CR and a LF. FILOTB DDB(A4) MOVB #12,D1 FILOTB DDB(A4) CLOSE DDB(A4) ; close output file. JMP LOOP ; and back. EXIT: EXIT ; ; Workarea and Constants ; DSECT .=0 DDB: BLKB D.DDB JOB: BLKB 8. GUARD: BLKW 1 ; just in case MEMSIZ=. PSECT PSEUDO: RAD50 /PSEUDO/ END .