Google
 

Trailing-Edge - PDP-10 Archives - AP-4172F-BM - 3a-sources/mailer.mac
There are 23 other files named mailer.mac in the archive. Click here to see a list.
;<3-UTILITIES>MAILER.MAC.6,  8-Nov-77 10:47:45, EDIT BY KIRSCHEN
;MORE COPYRIGHT UPDATING...
;<3-UTILITIES>MAILER.MAC.5, 26-Oct-77 11:07:42, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-UTILITIES>MAILER.MAC.4, 30-Sep-77 09:45:21, EDIT BY CROSSLAND
;REMOVE TIME ZONE ON DATE:  FIELD
;<3-UTILITIES>MAILER.MAC.3, 28-Sep-77 02:32:10, EDIT BY CROSSLAND
;CONVERT TO ARPA SYTLE MAIL.TXT FILE FORMAT
;<3-UTILITIES>MAILER.DIF.2, 25-Sep-77 02:06:36, EDIT BY CROSSLAND
;<3-UTILITIES>MAILER.MAC.2, 25-Aug-77 11:31:42, EDIT BY KIRSCHEN
;FIX VERSION NUMBERS FOR RELEASE 3
;<3-UTILITIES>MAILER.MAC.1, 22-Aug-77 17:02:39, EDIT BY MILLER
;TCO 1857. CHECK FOR NULLS AND USE TTMSG
;<2-UTILITIES>MAILER.MAC.22, 27-Dec-76 17:06:30, EDIT BY HURLEY
;<2-UTILITIES>MAILER.MAC.21, 22-Dec-76 13:47:33, EDIT BY HURLEY
;<2-UTILITIES>MAILER.MAC.20, 13-Oct-76 09:57:47, EDIT BY MILLER
;<2-UTILITIES>MAILER.MAC.19, 13-Oct-76 09:46:23, EDIT BY MILLER
;AND MORE
;<2-UTILITIES>MAILER.MAC.18, 13-Oct-76 09:35:48, EDIT BY MILLER
;MORE FIXES
;<2-UTILITIES>MAILER.MAC.17, 23-Sep-76 09:05:04, EDIT BY MILLER
;CREATE MAIL.TXT IN SYSTEM IF IT DOESN'T EXIST
;<2-UTILITIES>MAILER.MAC.16, 21-Sep-76 13:32:03, EDIT BY MILLER
;<2-UTILITIES>MAILER.MAC.15, 21-Sep-76 11:52:03, EDIT BY MILLER
;DON'T TELL PTYS "YOU HAVE A MESSAGE"
;<2-UTILITIES>MAILER.MAC.14, 20-Sep-76 11:54:12, EDIT BY MILLER
;<2-UTILITIES>MAILER.MAC.13, 20-Sep-76 10:58:46, EDIT BY MILLER
;MAKE IT WORK FOR 1B OR 2 FORMS OF USER NAME
;<2-UTILITIES>MAILER.MAC.12, 20-Sep-76 10:46:33, EDIT BY MILLER
;<2-UTILITIES>MAILER.MAC.11, 20-Sep-76 10:43:14, EDIT BY MILLER
;MAKE SPECIAL CHECK FOR SYSTEM MESSAGE
;<2-UTILITIES>MAILER.MAC.10, 16-Sep-76 15:46:00, EDIT BY MILLER
;RETURN CAPX1 FOR ATTEMPT TO SEND TO SYSTEM
;<2-UTILITIES>MAILER.MAC.9, 16-Sep-76 14:06:22, EDIT BY MILLER
;CHECK FOR RCUSR FAILURE IN USRDIR
;<2-UTILITIES>MAILER.MAC.8, 16-Sep-76 12:59:33, EDIT BY MILLER
;MAKE IT WORK WITH OLD OR NEW IPCF FORMATS
;<2-UTILITIES>MAILER.MAC.7, 16-Sep-76 10:08:46, EDIT BY MILLER
;FIX FROM MESSAGE
;<2-UTILITIES>MAILER.MAC.6, 16-Sep-76 09:36:44, EDIT BY MILLER
;MORE RELEASE 2 CHANGES
;<2-UTILITIES>MAILER.MAC.5, 14-Sep-76 15:07:39, EDIT BY MILLER
;FEED GTDAL A DIR # INSTEAD OF A USER #
;<2-UTILITIES>MAILER.MAC.4, 13-Sep-76 11:45:08, EDIT BY MILLER
;MORE OF THE SAME
;<2-UTILITIES>MAILER.MAC.3, 13-Sep-76 11:36:59, EDIT BY MILLER
;CHANGE TO WORK ON MULTIPLE STRUCTURES
;<1B-UTILITIES>MAILER.MAC.4,  9-Jul-76 09:39:06, EDIT BY HURLEY
;INCREASED VERSION NUMBER FOR RELEASE 1B
;<1B-UTILITIES>MAILER.MAC.3, 14-JUN-76 13:55:36, EDIT BY JMCCARTHY
;<1B-UTILITIES>MAILER.MAC.2,  8-JUN-76 16:23:43, EDIT BY HURLEY
;TCO 1371 - USERS DON'T ALWAYS KNOW THEY HAVE A MESSAGE
;<1A-UTILITIES>MAILER.MAC.26,  6-MAY-76 10:58:03, EDIT BY HURLEY
;<1A-UTILITIES>MAILER.MAC.22,  8-APR-76 11:12:53, EDIT BY HURLEY
;TCO 1244 - ADD .DIRECT .XTABM FOR MACRO 50 ASSEMBLIES
;<1A-UTILITIES>MAILER.MAC.21, 31-MAR-76 10:09:40, EDIT BY HURLEY
;TCO # 1227 - ADD TOPS-20 ENTRY VECTOR AND VERSION NUMBER
;<V-SOURCES>MAILER.MAC.20, 27-FEB-76 14:17:39, EDIT BY MILLER
;TCO 1121. MAKE [YOU HAVE A MESSAGE] GO TO ALL APPROPRIATE JOBS
;<V-SOURCES>MAILER.MAC.18, 19-DEC-75 12:59:11, EDIT BY MILLER



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	TITLE MAILER
	SEARCH MONSYM,MACSYM
	SALL
	IFNDEF .PSECT,<
	.DIRECT .XTABM>

; VERSION NUMBER DEFINITIONS

VMAJOR==3		;MAJOR VERSION OF MAILER
VMINOR==0		;MINOR VERSION NUMBER
VEDIT==6		;EDIT NUMBER
VWHO==0			;GROUP WHO LAST EDITED PROGRAM (0=DEC DEVELOPMENT)

VMAILR== <VWHO>B2+<VMAJOR>B11+<VMINOR>B17+VEDIT

;DEFINE REGISTERS

A==1
B==2
C==3
D==4
W==5
W1==6
W2==7
W3==10
W4==11
W5==12
W6==13
P==17
NOACK==2			;NO MESSAGES COULD BE SENT
NOACK1==1			;ONE OR MORE IDS WERE BAD
NOACKQ==1			;QUOTA EXCEEDED
NOACKB==0			;STANDARD MEANINGLESS ERROR
.IPCSN==67			;INFO WEND NAME FUNCTION
MAXTRY==5
SYSCOD==-2			;SPECIAL CODE FOR SYSTEM MESSAGE


MESS==10000			;MESSAGE BUFFER
USERS==^D512
USRBLK=11000
FILBUF==USRBLK+USERS
FILSIZ==^D50
BIGBUF==FILBUF+FILSIZ
SIZE==^D500000/5		;SIZE OF MESSAGE BUFFER
AREA==BIGBUF+SIZE		;FREE SPACE AREA
FRESIZ==5000			;LEAVE LOTS OF ROOM
FREHD:	Z AREA

FLAGWD:	0			;FLAG WORD
CONDIR:	BLOCK 1			;SAVE CONNECTED DIR HERE
SYSDIR:	BLOCK 1			;REMEMBER SYSTEM NUMBER HERE
SYSDI1:	BLOCK 1			;DIR OF SYSTEM
STACK:	BLOCK 20		;PDL FOR MAILER

DEFPKT:				;PACKET TO DEFINE MAILER
	4			;ASSIGN TO THIS JOB
	0
	ASCIZ /[SYSTEM]MAILER/	;MY NAME
ENDPKT:				;END OF PACKET
SAVPID:	Z 0			;SAVE USSER'S PID
JFN:	Z 0			;WHERE TO DAVE JFN
SAV:	BLOCK 1			;SAVE SP
GTINF:	BLOCK <.JICPJ-.JITNO+1>	 ;GETJI STORES DATA HERE
USRBUF:	ASCII /PS:</
	BLOCK 11		;WHERE TO FORM USER NAME FOR RCDIR
ERRORS:	Z 0			;ERROR COUNT
MYPID:	Z 0		;MY ID
SENDQ:	Z 0
ERRSTK:	BLOCK ^D200
LEVTAB:	ADD1
	ADD1
	ADD1
CHNTAB:	1,,GOTONE
ADD1:	Z 0
FRMNAM:	BLOCK 1
FRMMSG:	BLOCK 30		;HOLD FROM MESSAGE HERE

OPDEF RET [POPJ P,]
OPDEF CALL [PUSHJ P,]
	RELOC 1000-140		;SSTART ON A CLEAN PAGE
;CODE

;PROGRAM ENTRY VECTOR

ENTVEC:	JRST MAILER		;STARTING LOCATION
	JRST MAILER		;REENTER LOCATION
	VMAILR			;VERSION NUMBER
ALLOC:	SETZB W4,W5		;POINTER AND SIZE OF BLOCK
	MOVEI W,FREHD		;WHERE IT ALL STARTS
LOOK:	HRRZ W2,(W)		;WHERE NEXT BLOCK IS
	JUMPE W2,FINAL		;AT THE END. LOOK AT WHAT WE HAVD
	HLRZ W1,(W2)		;COUNT
	CAIN W1,(A)		;EXACT MATCH?
	JRST USEIT		;YES. DO IT
	CAIG W1,(A)		;BIG ENOUGH?
	JRST NOPE		;NO. FOO

;FOUND A CANDIDATE. SEE IF HE'S BETTER THAN THE LAST

	SKIPE W5		;GOT ONE YET?
	CAIGE W1,(W5)		;YES. THIS ONE BETTER?
	SKIPA W5,W1		;YES. USE IT
	JRST NOPE		;NO
	MOVE W4,W		;REMEMBER POINTER
NOPE:	HRRZ W,(W)		;GET NEXT BLOCK
	JRST LOOK		;GO PROCESS IT
FINAL:	SKIPN W1,W5		;FOUND A GOOD ONE?
	RET			;NO. BOMB TIME
	MOVE W,W4		;POINTER
USEIT:	HRRZ W4,(W)		;AREA TO ALLOCATE
	MOVNI W1,(A)		;NUMBRE OF WORDS NEEDED
	HRLZS W1		;NEGATIVE TO LEFT HALF
	ADD W1,(W4)		;DO IT
	ADDI W4,(A)		;WHERE NRW BLOCK IS
	TLNE W1,-1		;ANYTHING LEFT?
	MOVEM W1,(W4)		;YES. MAKE IT A NEW BLOCK
	HRRZ W5,(W)
	HRLZM A,(W5)		;ASSIGNED BLOCK
	HRRM W4,(W)		;LINK IN NEW FREE BLOCK
	MOVEI A,(W5)		;WHAT WE ASSIGNED
	AOS (P)
	RET			;GOOD RETURN
;THIS IS THE DEALLOCATE CODE. INPUT IS A=POINTER TO BLOCK

DEALL:	MOVEI W,FREHD
LOOK1:	HRRZ W1,(W)		;BLOCK HEAD
	JUMPE W1,HERE		;IF AT THE END IT GOES HERE
	CAIL W1,(A)		;PAST THIS BLOCK?
	JRST HERE		;YES. PU IT IN HERE
	MOVE W,W1		;NO. STEP
	JRST LOOK1		;GO DO MORE
HERE:	CAIN W,FREHD		;AT THE TOP?
	JRST LNKDWN		;YES. CANT MERGE UP
	HLRZ W1,(W)		;GET SIZE OF PREVIOUS
	ADDI W1,(W)		;TO THE END
	CAIE W1,(A)		;UP TO THE BLOCK RELEASING?
	JRST LNKDWN		;NO. LINK IT IN
	HLRZ W2,(A)		;DO THE MERGE
	HLRZ W1,(W)
	ADDI W1,(W2)		;NEW TOTAL SIZE
	SETZM (A)		;BLOT OUT THIS HEADER
	HRLM W1,(W)		;NEW COUNT
	JRST SEEDWN		;TRY TO MERGE DOWN
LNKDWN:	HRRZ W2,(W)		;LINK TO NEXT
	HRRM A,(W)		;PUT THIS NEW BLOCK IN
	HRRM W2,(A)		;AND PUT OLD LINK IN IT
	MOVE W,A		;NEW BASE BLOCK
SEEDWN:	HLRZ W1,(W)		;COUNRT
	ADDI W1,(W)		;END OF THIS BLOCK
	HRRZ W2,(W)		;NEXT BLOCK
	CAIE W1,(W2)		;THIS IT?
	RET			;NO. DONE
	HLRZ W3,(W2)		;YES. MUST MERGE THEM
	HLRZ W1,(W)		;COUNT OF PREVIOUS
	ADDI W3,(W1)		;NEW COUNT OF MERGED BLOCKS
	HRLM W3,(W)
	HRRZ W3,(W2)		;ITS LINK
	HRRM W3,(W)		;NEW DOWN LINK FOR THIS GUY
	SETZM (W2)		;CLEAR IT
	RET			;ALL DONE

DOUSR:	MOVEI W,0		;WORK
	MOVEI C,","		;FOR CONVENIENCE
TOPOF:	SKIPN B,(D)		;WORK TO DO?
	POPJ P,			;NO. GO BACK
	SKIPE W			;NEED A COMMA?
	IDPB C,A		;YES. PUT IT IN
	CAMN B,[SYSCOD]		;IS THIS SYSTEM?
	JRST SPCUSR		;YES. GO DO IT
	DIRST			;CONVERT TO A STRING
	 JRST BAH		;WONT CONVERT
	CAMN B,SYSDIR		;IS THIS SYSTEM?
	JRST [	MOVE B,[SYSCOD]	;YES. GET INTERNAL VALUE
		MOVEM B,0(D)	;STORE IT
		JRST .+1]	;AND PROCEED
TOPOF1:	AOS W
	ADDI D,1		;NEXT ONE
	CAIGE W,7		;MOR ON THIS LINE?
	JRST TOPOF		;YES
	HRROI B,[ASCIZ /
    /]
	SETZ C,			; STOP ON NULL
	SOUT
	JRST DOUSR
BAH:	AOS W1,ERRORS		;A BADDY
	SETOM (D)		;DONT TRY AGAIN
	AOS D			;DO NEXT ONE NEXT
	HRRZM A,ERRSTK-1(W1)	;PUT IN REASON
	AOS W1,ERRORS		;NEXT LOC
	MOVEM B,ERRSTK-1(W1)
	SKIPE W			;AT START OF LINE?
	BKJFN			;NO. ERASE THE COMMA
	 JFCL			;WILL WORK
	JRST TOPOF

;SPECIAL USER CODE FOUND

SPCUSR:	HRROI B,[ASCIZ /SYSTEM/] ;YES. GET THE NAME
	SETZ C,
	SOUT			;PUT IT IN
	MOVEI C,","		;PUT BACK THE PUNCTUATION
	JRST TOPOF1		;AND GO BACK IN
MAILER:	RESET
	HRROI A,FRMMSG		;GET FROM MESSAGE BUFFER
	HRROI B,[ASCIZ /
[You have a message from /]
	SETZ C,
	SOUT			;MOVE MESSAGE TO THE BUFFER
	MOVEM A,FRMNAM		;SAVE PLACE TO PUT NAME
	MOVE P,[IOWD 20,STACK]
	MOVX A,RC%EMO		;EXACT MATCH PLEASE
	HRROI B,[ASCIZ /SYSTEM/] ;GET USER CODE FOR SYSTEM
	RCUSR			;GET IT
	ERJMP [	SETZ C,		;NO SUCH DIR
		JRST .+1]	;AND MERGE IN
	TXNE A,RC%NOM!RC%AMB	;FOUND IT?
	SETZ C,			;NO
	MOVEM C,SYSDIR		;REMEMBER THE NUMBER
	MOVX A,RC%EMO		;EXACT MATCH AGAIN
	HRROI B,[ASCIZ /PS:<SYSTEM>/]
	RCDIR			;NOW GET DIRECTORY DESCRIPTOR
	ERJMP [	SETZ C,
		JRST .+1]	;NO SUCH DIR
	TXNE A,RC%NOM!RC%AMB	;DID IT MATCH
	SETZ C,			;NO
	MOVEM C,SYSDI1		;SAVE DIRECTORY NUMBER
	MOVEI A,400000		;SELF
	MOVE B,[LEVTAB,,CHNTAB]	;INT LOCS
	SIR
	MOVSI B,(1B0)		;ENABLE 0 ONLY
	AIC
	EIR			;TRUN IT ALL ON
	MOVSI A,FRESIZ		;SIZE OF FREE AREA
	MOVEM A,AREA		;INITIALIZE FREE AREA
	MOVSI W,(1B5)		;GET ME A PID
	SETZB W1,W2		;ZERO FOR TWO PIDS
MAIL1:	MOVE W3,[ENDPKT-DEFPKT,,DEFPKT]
	MOVEI A,4
	MOVEI B,W		;THE PACKET
	MSEND			;DO IT
	 JRST [	MOVEI A,^D500	;SLEEP FOR AWHILE
		DISMS
		SKIPN W1	;GOT A PID?
		JRST MAILER	;NO. START OVER
		SETZ W,		;YES. INIT HEADER
		JRST MAIL1]	;AND SEND IT AGAIN
	MOVEM W1,MYPID		;SAVE ASSIGNED PID

;NOW GET SOME MESSAGES TO ACT UPON

MAIN:	MOVEI A,7
	MOVEI B,D
	MOVE W,MYPID		;RECEIVE ON MY ID
	MOVEI D,.MUQRY		;DO A QUERY
	MUTIL			;DO IT
	 JRST NONE		;NONE WAITING
	MOVEI A,7
	MOVEI B,W		;FOR GETTING THE MESSAGE
	MOVE W3,[1000,,MESS]	;FO THE MESSAGE
	MOVE W2,MYPID		;RECEIVER'S PID
	SETZ W6,		;MAKE SURE IPCF STORES HERE
	MRECV			;GET A MESSAGE
	 JFCL			;????????

;RECEIVED A MESSAGE. SEE WHAT IT IS 

	TRNN W,7B32		;MAYBE FROM INFO?
	JRST NOTINF		;NO  GO ON
	TRNN W,77B29		;AN ERROR CONDITION?
	JRST MAIN		;NO. DONT LOOK AT IT
	MOVE B,W
	ANDI B,7B32		;LOOK AT SENDER INFO
	CAIE B,20		;FORM INFO?
	JRST MAIN		;NO. MUST BE A LOST MESSAGE
	ANDI W,77B29		;LOOK AT ERROR
	CAIE W,<.IPCSN>B29	;INFO RESSTART?
	JRST [	HRROI A,[ASCIZ /
?MAILER: UNKNOWN ERROR CONDITION FROM INFO
/]
		PSOUT
		HALTF]
	SETZB W,W2		;YES. MUST START AGAIN
	MOVE W1,MYPID
	JRST MAIL1		;SEND OFF MY NAME THEN
;NO MESSAGES WAITING

NONE:	SKIPE SENDQ		;REPLIES WATING?
	JRST DOQ1		;YES. GO DO THEM
	MOVEI W,.MUPIC		;ENABLE FOR INTS
	MOVE W1,MYPID
	SETZ W2,		;ON CHANNEL 0
	MOVEI A,3
	MOVEI B,W		;WHERE THE PACKET ISS
	MUTIL			;DO IT
	 JFCL
	WAIT			;WAIT HERE FOR INT
GOTONE:	SETO W2,		;RELEASE CHANNEL
	MUTIL
	 JFCL
	MOVEI A,MAIN		;MAIN LOOP
	MOVEM A,ADD1
	DEBRK			;GO GET IT
;MESSAGE NOT FROM INFO. MUST BE WORK TO DO

NOTINF:	MOVEM W1,SAVPID		;NO. SAVE IT FOR LATER
	SKIPN W6		;GOT A CONNECTED DIR IN W6?
	JRST [	HLRZ W6,W4	;NO. ASSUME OLD STYLE IPCF THEN
		HRRZS W4	;AND ISOLATE USER NUMBER
		JRST .+1]	;AND PROCEED
	MOVEM W6,CONDIR		;SAVE CONNECTED DIR HERE
	SETZM ERRORS		;NO ERRORS TO START
	MOVSI A,100001		;OLD FILE
	HRROI B,MESS		;WHERE THE FILE NAME IS
	SETZM JFN		;NO JFN TO START
	GTJFN			;GET THE FILE NAME
	 JRST NACK		;CANT DO IT
	MOVEM A,JFN		;STASH AWAY JFN
	MOVE B,[440000,,200000]	;OPENF BITS
	OPENF			;GET FILE
	 JRST [	MOVE A,JFN
		RLJFN
		 JFCL
		SETZM JFN	;NO FILE OPENED
		JRST NACK]	;CANT DO IT

;GOT FILE OPEN. NOW BUILD MESSAGE

	SETZM ERRORS		;NO ERRORS
	HRROI B,[ASCIZ /   --------
DATE: /]
	HRROI A,BIGBUF
	SETZ C,
	SOUT			;PUT MESSAGE IN BUFFER
	SETO B,
	MOVSI C,(OT%NSC)	;FORMAT BITS
	ODTIM			;PUT THE TIME IN THE FILE
	HRROI B,[ASCIZ /
FROM: /]
	SETZ C,
	SOUT			;PUT IN SENDER'S NAME
	MOVE B,W4		;LOGGED IN DIRECTORY
	DIRST			;PUT IT IN
	 JFCL
	MOVEM A,SAV		;STASH AWAY SP
	MOVE A,FRMNAM		;GET PLACE TO PUT NAME IN FROM MESSAGE
	MOVE B,W4		;USER NUMBER
	DIRST			;PUT IT IN
	 JFCL
	HRROI B,[ASCIZ /]
/]
	SETZ C,
	SOUT			;TERMINATE THE MESSAGE
	IDPB C,A		;AND APPEND A NULL

;NOW GET LIST OF TO'S 
	MOVE A,JFN		;THE FILE'S JFN
	BIN			;GET FLAG WORD FIRST
	MOVEM B,FLAGWD		;SAVE IT FOR POSTERITY
	MOVE B,[POINT ^D36,USRBLK] ;WHERE TO PUT THEM
	MOVEI C,USERS-1		;MAX NUMBER
	SETZ D,
	SIN			;READ IN USER'S TO SEND TO
	JUMPN C,ALLIN		;IF ALL IN GO
	MOVEI B,(B)		; SKIP OVER THE EXTRAS
	SIN			;SKIP OVER THE REST OF THEM
ALLIN:	MOVEI D,(B)		;SAVE END VALUE
	GTSTS			;GET FILE STATUS
	CAIE D,USRBLK		;NO USER'S GIVEN?
	TLNE B,1000		;EOF?
	JRST NACK		;YES. BOMB
	MOVE A,SAV		;GET OLD POINTER
	HRROI B,[ASCIZ /
TO: /]
	PUSH P,C		;SAVE COUNT OF WORDS LEFT
	SETZ C,
	SOUT			;PREPARE FOR HEADER
	MOVEI D,USRBLK		;BEGINNING OF THEM
	PUSHJ P,DOUSR		;PROCESSS USER NAMES
	MOVEM A,SAV		;STASSH AWAY POINTER AGAIN
	POP P,C			;GET BACK THE COUNT
ONEUSR:	PUSH P,D		;SAVE POINTER
	MOVE A,JFN
	MOVEI B,(D)
	HRLI B,444400		;REBUIL STRING POINTER
	SETZ D,
	MOVE W,C		;SAVE COUNT
	SKIPE C			;ROOM LEFT?
	SIN			;GET CC LIST
	SETZM 1(B)		;GUARANTEE A DOUBLE ZERO
	POP P,D			;GET USER LIST BACK
	JUMPN C,DOCC		;LESS THAN 100?
	MOVEI B,(B)		; NULL POINTER
	SIN			;READ IN THE REST
DOCC:	GTSTS			;EOF?
	TLNE B,1000
	JRST NACK		;YES. BOMB IT
	MOVE A,SAV
	CAIN W,1(C)		;FOUND ANY CC'S?
	JRST ONMSG		;NO. GO AWAY
	HRROI B,[ASCIZ /
CC: /]
	SETZ C,
	SOUT			;PUT IN HEADER
	PUSHJ P,DOUSR		;DO CC LIST AS WELL
ONMSG:	HRROI B,[ASCIZ /
   _____
/]
	SETZ C,
	SOUT			;MESSAGE SEPARATOR
	MOVEI B,0
	TLNE A,(70B5)		;NOW AT LAST BYTE IN WORD
	JRST [	IDPB B,A	;NO, PAD ANOTHER NULL
		JRST .-1]
	MOVE B,A
	HRLI B,(POINT 36,0,35)	;CHANGE TO 36-BIT
	MOVE A,JFN		;FILE JFN
	MOVEI C,SIZE		;MAXIMUM SIZE OF MESSAGE
	SETZM D			;STOP ON A NULL
	SIN			;GET MESSAGE
	MOVE C,B		;SAVE POINTER
	GTSTS			;GET FILE STATUS
	TXNN B,GS%EOF		;AT EOF NOW?
	JRST NACK		;NO. FOUND A NULL THEN
	MOVE B,C		;RESTORE POINTER
	; ..
;BIGBUF NOW CONTAINS THE ENTIRE MESSAGE. USRBLK CONTAINS THE
;LIST OF USERS TO GET THIS MESSAGE. SEND IT TO EACH

OVER:	PUSHJ P,DELFIL		;GET RID OF THE FILE
	MOVE A,[POINT 36,[ASCIZ /   ========
/]]
	MOVNI C,3		;WRITE 3 WORDS
	SIN			;TIE OFF THE MESSAGE
	SETZ C			;PUT ON NULL AT END
	IDPB C,B		;PUT A ZERO ON THE END
	MOVEI W,(B)		;GET FINAL WORD
	SUBI W,BIGBUF-1		;CALCULATE NUMBER OF WORDS
	IMULI W,5		;CHARACTERS PER WORD

;NOW W HAS COUNT OF CHARACTERS IN MSG
;NOW SET TO SEND SOME MESSAGES

	MOVEI D,USRBLK		;WHERE THE USER NAMES AR	 STORED
SNDOFF:	SKIPN B,(D)		;GET USER
	JRST FINIS		;ALL DONE
	AOS D			;BUMP TO THE NEXT
	CAMN B,[-1]		;BAD ENTRY?
	JRST SNDOFF		;YES
	CAME B,[SYSCOD]		;IS IT SYSTEM?
	JRST NOSYS		;NO. NO SPECIAL CHECKING THEN
	TRNE W5,600000		;YES. IS THIS FROM A PRIVILEGED GUY?
	JRST NOSYS1		;YES. ALLOW IT THEN
	MOVE W1,CONDIR		;