;
; NAME: 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
;
; 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 inpure area to make reentrant.
;
;
SEARCH SYS
SEARCH SYSSYM
VMAJOR=1
VMINOR=0
VEDIT=4.
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 #' ,@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 #<J.LPT!J.TSK>,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
MOVB #';,D1 ; make it look like SEND...
FILOTB DDB(A4)
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 #7,D1
FILOTB DDB(A4) ; give him a BELL 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