Trailing-Edge
-
PDP-10 Archives
-
BB-H138A-BM
-
3a-sources/rdmail.mac
There are 20 other files named rdmail.mac in the archive. Click here to see a list.
;<3A.UTILITIES>RDMAIL.MAC.8, 27-Jul-78 17:48:07, EDIT BY MILLER
;CHANGE EDIT NUMBER
;<3A.UTILITIES>RDMAIL.MAC.7, 30-May-78 14:14:57, EDIT BY OSMAN
;increase pushdown stack size
;<3A.UTILITIES>RDMAIL.MAC.6, 30-May-78 10:42:07, EDIT BY MILLER
;FIX BUG IN NXTMS1 THAT CLOBBERED BYTE POINTER
;<3A.UTILITIES>RDMAIL.MAC.5, 15-May-78 11:33:57, EDIT BY OSMAN
;PUT /L BACK IN
;USE COMND JSYS
;<4.UTILITIES>RDMAIL.MAC.3, 30-Nov-77 17:55:32, EDIT BY CROSSLAND
;FIX UP ARPA SYSTEM TEST.
;<4.UTILITIES>RDMAIL.MAC.2, 16-Nov-77 20:43:45, EDIT BY MILLER
;FIX TXTFRM TO SET OF%PDT IF /P IS SPECIFIED
;<4.UTILITIES>RDMAIL.MAC.1, 5-Nov-77 18:21:28, EDIT BY MILLER
;FIX SPECIAL USER CODE TO WAIT FOR CRLF
;<3-UTILITIES>RDMAIL.MAC.6, 26-Oct-77 11:15:31, EDIT BY KIRSCHEN
;UPDATE COPYRIGHT FOR RELEASE 3
;<3-UTILITIES>RDMAIL.MAC.5, 29-Sep-77 15:58:56, EDIT BY CROSSLAND
;FIX EOF LOGIC ON NEW FORMAT FILES
;<3-UTILITIES>RDMAIL.MAC.4, 29-Sep-77 15:19:33, EDIT BY CROSSLAND
;FIX SEARCH FOR MESSAGE ON BOUNDRY BETWEEN NEW AND OLD
;<3-UTILITIES>RDMAIL.MAC.3, 28-Sep-77 02:31:00, EDIT BY CROSSLAND
;CONVERT TO UNDERSTAND BOTH NEW AND OLD FORMAT MAIL.TXT FILES
;<3-UTILITIES>RDMAIL.MAC.2, 25-Aug-77 10:47:38, EDIT BY KIRSCHEN
;FIX VERSION NUMBER FOR RELEASE 3
;<3-UTILITIES>RDMAIL.MAC.1, 16-Aug-77 17:56:35, EDIT BY MILLER
;ADD PARTIAL RECOG FOR "SPECIAL" USER
;<2-UTILITIES>RDMAIL.MAC.22, 20-Jan-77 14:18:56, EDIT BY HURLEY
;FIX HELP MESSAGE
;<2-UTILITIES>RDMAIL.MAC.21, 27-Dec-76 17:07:41, EDIT BY HURLEY
;<2-UTILITIES>RDMAIL.MAC.20, 2-Nov-76 12:55:14, EDIT BY MILLER
;<2-UTILITIES>RDMAIL.MAC.19, 2-Nov-76 12:28:14, EDIT BY MILLER
;<2-UTILITIES>RDMAIL.MAC.18, 2-Nov-76 12:19:41, EDIT BY MILLER
;<2-UTILITIES>RDMAIL.MAC.17, 2-Nov-76 12:15:43, EDIT BY MILLER
;FIX UP FOR POST MARK WHICH OVERLAPS PAGE BOUNDARY
;<2-UTILITIES>RDMAIL.MAC.16, 1-Nov-76 18:16:48, EDIT BY MILLER
;CHECK FOR EOF PAGE IN PRE SCAN OF MESSAGES
;<2-UTILITIES>RDMAIL.MAC.15, 1-Nov-76 17:50:58, EDIT BY MILLER
;MORE FIXES FOR SPEED UP
;<2-UTILITIES>RDMAIL.MAC.14, 1-Nov-76 13:42:41, EDIT BY MILLER
;MORE FIXES
;<2-UTILITIES>RDMAIL.MAC.13, 1-Nov-76 13:21:59, EDIT BY MILLER
;<2-UTILITIES>RDMAIL.MAC.12, 1-Nov-76 13:20:13, EDIT BY MILLER
;FIXES FOR SCAN SPEED UP
;<2-UTILITIES>RDMAIL.MAC.11, 1-Nov-76 13:12:46, EDIT BY MILLER
;TCO 1640. IMPROVE SCAN FOR FIRST RELEVANT MESSAGE
;<2-UTILITIES>RDMAIL.MAC.10, 27-Sep-76 09:14:21, EDIT BY MILLER
;FIX FOR 0 LENGTH MAIL FILES
;<2-UTILITIES>RDMAIL.MAC.9, 21-Sep-76 11:43:51, EDIT BY MILLER
;FIX /M AND SPECIAL MESSAGES
;<2-UTILITIES>RDMAIL.MAC.8, 20-Sep-76 12:55:28, EDIT BY MILLER
;<2-UTILITIES>RDMAIL.MAC.7, 20-Sep-76 12:48:52, EDIT BY MILLER
;FIX DATE FOR MESSAGE-OF-THE-DAY
;<2-UTILITIES>RDMAIL.MAC.6, 20-Sep-76 11:35:41, EDIT BY MILLER
;FIX MESSAGE
;<2-UTILITIES>RDMAIL.MAC.5, 14-Sep-76 12:40:31, EDIT BY MILLER
;CHANGE RCDIR TO RCUSR AT DOIT
;<2-UTILITIES>RDMAIL.MAC.4, 14-Sep-76 11:46:18, EDIT BY MILLER
;MORE UPGRADE FIXES
;<2-UTILITIES>RDMAIL.MAC.3, 10-Sep-76 10:09:22, Edit by HESS
;TCO 1522 - UPGRADE FOR VERSION 2 RELEASE
;<1B-UTILITIES>RDMAIL.MAC.5, 9-Jul-76 09:39:42, EDIT BY HURLEY
;INCREASED VERSION NUMBER FOR RELEASE 1B
;<1B-UTILITIES>RDMAIL.MAC.4, 9-JUN-76 14:23:43, EDIT BY MILLER
;<1B-UTILITIES>RDMAIL.MAC.3, 7-JUN-76 17:45:11, EDIT BY HALL
;TCO 1343. CHANGE HELP TEXT TO REFLECT /L
;<1B-UTILITIES>RDMAIL.MAC.2, 3-JUN-76 11:00:46, EDIT BY MILLER
;<1B-UTILITIES>RDMAIL.MAC.1, 3-JUN-76 10:54:56, EDIT BY MILLER
;TCO 1343. ADD /L SWITCH
;<1A-UTILITIES>RDMAIL.MAC.37, 6-MAY-76 11:01:55, EDIT BY HURLEY
;<1A-UTILITIES>RDMAIL.MAC.34, 8-APR-76 16:29:26, EDIT BY HURLEY
;<1A-UTILITIES>RDMAIL.MAC.33, 8-APR-76 11:50:36, EDIT BY HURLEY
;TCO 1244 - ADD .DIRECT .XTABM FOR MACRO 50 ASSEMBLIES
;<V-SOURCES>RDMAIL.MAC.32, 16-MAR-76 15:41:07, EDIT BY KIRSCHEN
;tco 1186 - fix date example in help text
;<V-SOURCES>RDMAIL.MAC.31, 6-FEB-76 09:27:54, EDIT BY MILLER
;MCO 1060
;<V-SOURCES>RDMAIL.MAC.29, 19-DEC-75 10:38: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) 1977 BY DIGITAL EQUIPMENT CORPORATION
SEARCH MONSYM,MACSYM,CMD
.REQUIRE SYS:MACREL,SYS:CMD
TITLE RDMAIL
SALL
IFNDEF .PSECT,<
.DIRECT .XTABM>
IFDEF .PSECT,<
.DIRECT FLBLST
>
;DEFINE REGISTERS
A==1
B==2
C==3
D==4
W==5
W1==6
W2==7
P==17
;DEFINE VERSION CONSTITUENTS
PRGVER==3 ;VERSION 3
PRGMIN==1 ;MINOR VERSION
PRGEDT==10 ;EDIT NUMBER
PRGCST==0 ;DEC SOFTWARE
;LOCAL STORAGE
INTCAR==5 ;INTERRUPT CHARACTER
STKSIZ==200
STACK: BLOCK STKSIZ
CMDSTG ;COMND JSYS STORAGE
ADD1: Z
LEVTAB: ADD1
ADD1
ADD1 ;THE LEVEL TABLE
CHNTAB: 1,,SKPMSG ;TERM INT TO PURGE THIS MESSAGE
JFN: Z 0 ;JFN OF INPUT FILE
OJFN: BLOCK 1 ;OUTPUT JFN
SAVACS: Z
STOP: Z ; STOP AFTER EACH MESSAGE
PRUSE: Z
MOD: Z 0 ;MESSAGE OF THE DAY FLAG
FILFND: Z 0 ;FILE FOUND FLAG
HLPFLG: 0 ;SAYS HELP WANTED
RLDATE: Z 0 ;FLAG
TIME: Z 0 ;DATE AND TIME TO BEGIN
MESSNO: Z 0 ;INTERNAL MESSAGE COUNTER
THISDT: 0 ;GTAD OF CURRENT TEXT-FORM MSG
BEGM: 0 ;CHAR COUNT AT START OF TEXT MSG
FILLEN: 0 ;EOF POINTER OF FILE
SKIPCH: 0 ;CHAR COUNT OF CURRENT MSG, TEXT FORM
FRMERC: 0 ;FORMAT ERROR MESSAGE COUNTER
BIGSTR==5000 ;BUFFER AREA
BIGBUF==BIGSTR+6 ;START OF BUFFER AREA
BUFSIZ==10000 ;SIZE OF BUFFER AREA
;THE ENTER VECTOR
ENTVEC: JRST START ;MAIN ENTRY
JRST START ;SAME AS MAIN
PRGVER_^D24!PRGMIN_^D18!PRGEDT!PRGCST_^D33
XWD TIME,START2
ENDVEC==. ;END OF ENTRY VECTOR
START: RESET
MOVEI A,.PRIOU ;DEFAULT OUTPUT JFN
MOVEM A,OJFN
MOVE P,[IOWD STKSIZ,STACK]
CALL CMDINI ;INITIALIZE FOR COMND JSYS
CALL CLRSTR ;CLEAR MAP
MOVEI A,.FHSLF ; SEE IF ENABLED
RPCAP ; GET THEM
TRNE C,-1 ; ANY SPECIALS SET?
JRST SPCIAL ; YES. MUST ASK THEN
NOSPC: GJINF ; GET JOB INFORMATION
MOVE B,A ; DIRECTORY NUMBER TO B
DOFILE: MOVE A,[POINT 7,BIGBUF] ;WHERE TO BUILD NAME
PUSH P,B ;SAVE DIR NUMBER
HRROI B,[ASCIZ /PS:</]
SETZ C,
SOUT ;MAKE IT GO TO PS ALWAYS
POP P,B ;RESTORE DIR NUMBER
DIRST ;GET HIS NAME
JFCL
MOVEI C,">" ;GET TERMINATOR
IDPB C,A ;STORE IT
HRROI B,[ASCIZ /MAIL.TXT/] ;THE FILE
SETZ C,
SOUT ;COPY IT
MOVX A,GJ%OLD!GJ%SHT+1 ;ONLY VERSION 1
HRROI B,BIGBUF ; THE NAME BUFFER
GTJFN ;GET IT
JRST [ SETOM FILFND ;NO LOCAL MESSAGE FILE FOUND
JRST SETPS1] ;GO DO SOME PROCESSING
SETZM FILFND ;INDICATE FILE FOUND
MOVEM A,JFN ;SAVE JFN
MOVE B,[1,,.FBREF] ;SAVE LAST READ DTAE
MOVEI C,D ;WHERE IT GOES
GTFDB ;GET IT
MOVEM D,TIME ;SAEV IT IN CASE
SETPS1: CALL SETPSI ;GO TURN ON PI'S
;FILE IS NOW OPEN. ASK HIM FOR DATE AND TINM TO START PROCESSING
GETDAT: PROMPT <Date and time (/H for help) >
SETZM HLPFLG ;NO HELP REQUEST YET
SETZM RLDATE ;NO REAL DATE YET
SETZM PRUSE ;ASSUME NO PERUSING
SETZM STOP ; ASSUME NO STOPPING
SETZM MOD ;NOT DOING MESSAGE OF THE DAY
MORE1: MOVEI A,[FLDDB. .CMCFM,,,,,[FLDDB. .CMTAD,CM%SDH,CM%IDA,,,[FLDDB. .CMTAD,CM%SDH,CM%ITM,,,[FLDDB. .CMTAD,,CM%IDA!CM%ITM,,,[FLDDB. .CMSWI,,SWTAB]]]]]
CALL RFIELD
LDB C,[331100,,(C)] ;SEE WHAT WAS INPUT
CAIE C,.CMTAD ;DATE INPUT?
JRST NODAT1 ;NO
MOVEM B,TIME ;REMEMBER THE TIME TYPED
SETOM RLDATE ;MARK THAT DATE TYPED
JRST MORE1 ;GET MORE OF LINE
NODAT1: CAIE C,.CMSWI ;SWITCH?
JRST NOSWI ;NO
MOVE B,(B) ;GET ENTRY FROM TABLE
CALL (B) ;EXECUTE THE SWITCH
JRST MORE1 ;GET MORE INPUT
SWTAB: %N,,%N
T A
T H
T L
T M
T P
T S
%N==.-SWTAB-1
.L: MOVX A,GJ%FOU+GJ%SHT
HRROI B,[ASCIZ /LPT:RDMAIL.OUT/]
GTJFN ;GET OUTPUT JFN
JRST [ HRROI A,[ASCIZ /
?LPT: not available for output
/]
PSOUT
RET] ;IGNORE IT
MOVE B,[070000,,100000]
OPENF ;OPEN LPT
JRST [ HRROI A,[ASCIZ /
?LPT: not available for output
/]
PSOUT
RET] ;GIVE UP
MOVEM A,OJFN ;NEW OUTPUT JFN
RET ;DONE
.P: SETOM PRUSE ;YES. SET THE FLAG
RET
.A: SETZM TIME ;YES.
SETOM RLDATE ;AND SAY FOUND A REAL TIME
RET
.S: SETOM STOP ;YES REMEMBER THIS
RET
.M: SETOM MOD ;YES. REMEMBER THIS
SKIPE RLDATE ;HAVE A REAL DATE YET?
POPJ P, ;YES. ALL DONE THEN
MOVNI A,5 ;GET CONSOLE TIME FOR THE JOB
RUNTM ;GET IT
GTAD ;GET NOW
IDIV C,B ;GET SECONDS
MUL C,[1B17]
DIVI C,^D<3600*24> ;COMPUTE FRACTIONS OF A DAY
SUB A,C ;COMPUTE LOGIN DATE AND TIME
MOVEM A,TIME ;NEW DEFAULT TIME
POPJ P, ;GO BACK
;READY TO PROCESS THE FILE
NOSWI: SKIPN HLPFLG ;HELP WANTED?
JRST NOSWI1 ;NO
CALL HLPOUT ;YES, PRINT IT
JRST GETDAT ;FLUSH REST OF LINE
NOSWI1: SKIPE MOD ;WANT MESSAGE OF THE DAY?
JRST START2 ;YES. GO DO IT
SKIPE FILFND ;NO. HAVE A LOCAL MESSAGE FILE?
JRST [ HALTF ;NO. STOP THEN
JRST START]
MOVE B,[440000,,200000] ;OPENF BITS
MOVE A,JFN ;THE JFN OF THE MESSAGE FILE
SKIPE PRUSE ;PERUSING?
TXO B,OF%PDT ;YES. SUPPRESS REFERNCE DATE UPDATE
OPENF ;OPEN IT
OPNFAL: JRST [ MOVE D,A ;SAVE ERROR MESSAGE
MOVE A,JFN ;GET FILE JFN
RLJFN ;GET RID OF JFN
JFCL
MOVEI A,101
MOVE B,[400000,,-1]
SETZ C,
CAIE D,OPNX2 ;WAS IT A ZERO LENGTH MAIL FILE?
ERSTR ;NO,LET MONITOR TELL HIM WHAT HAPPENED
JFCL
JFCL
HALTF ;DIE
JRST START] ;AND TRY AGAIN
MOVEI A,.FHSLF
EIR ;TURN ON THE INTERRUPT SYSTEM
SETZM MESSNO ;CLEAR INTERNAL COUNTER
SETOM FRMERC ;NO FORMAT ERROR MESSAGES YET
MOVE A,JFN ;SELECT WHICH FORMAT FILE IT IS
BIN ;FIRST WORD OF FILE
JUMPN B,TXTFRM ;IF NOT ZERO, IT'S TEXT.
LKTOP: SKIPN TIME ;HAVE A SPECIFIC TIME?
JRST UPTOP ;NO. DO ALL OF FILE
MOVE A,JFN ;THE JFN
MOVE B,[1,,.FBBYV] ;GET # OF FILE PAGES
MOVEI C,D ;LAST PAGE
GTFDB ;GET THE LAST PAGE
MOVEI D,-1(D) ;GET LAST PAGE NUMBER
CAIG D,2 ;MAKE SURE THIS IS WORTHWHILE
JRST UPTOP ;SHORT FILE. LOOK AT IT ALL
SETZM BIGSTR ;MAKE FIRST PAGE LOOK EMPTY
LKLOOP: HRL A,JFN ;THE JFN
HRR A,D ;THE FILE PAGE TO LOOK AT
MOVE B,[.FHSLF,,BIGSTR/1000] ;A WORK PAGE
MOVE C,BIGSTR ;GET FIRST WORD OF OLD PAGE
MOVEM C,BIGSTR+1000 ;MAKE IT NEXT WORD FOR NEW PAGE
MOVX C,PM%RD ;ACCESS BITS
PMAP ;GET THE PAGE
MOVSI C,-1000 ;LOOK AT WHOLE PAGE
SETZ W, ;NO POST MARK FOUND YET
LKLOP1: SKIPE BIGSTR(C) ;FOUND A NULL?
JRST LKLOP2 ;NO
SKIPN BIGSTR+1(C) ;ANOTHER NULL?
JRST LKLOP2 ;YES
HRROI A,BIGSTR+1(C) ;TRY TEXT TIME FIRST
MOVSI B,(IT%AIS) ;REQUIRE SECONDS IN TIME OF MSG
IDTIM ;GET TIME STAMP OF MSG
JRST [ MOVE B,BIGSTR+1(C) ;GET BINARY TIME STAMP
JRST .+1]
SETOM W ;AND IF NON-ZERO, REMEMBER IT
CAMGE B,TIME ;A MESSAGE TO START WITH?
MOVEI W,1 ;NO. GO ON
MOVEI B,0(D) ;GET PAGE #
IMULI B,1000 ;GET WORD NUMBER
ADDI B,1(C) ;WORD TO START WITH
MOVEM B,MESSNO ;REMEMBER IT
JUMPG W,LKLOP5 ;GO FOUND A MESSAGE BEFORE NOW
JRST LKLOP3 ;NEXT PAGE THEN
LKLOP2: AOBJN C,LKLOP1 ;DO ALL OF PAGE
JUMPE W,LKLOP3 ;IF NO POST MARK FOUND, CHECK ANOTHER PAGE
LKLOP5: CALL CLRSTR ;CLEAR MAP
SKIPE MESSNO ;FOUND ONE SOMEWHERE?
JRST LKLOP4 ;YES. GO DO IT THEN
HALTF ;DONE
JRST START ;START OVER
LKLOP3: SOJG D,LKLOOP ;DO PREVIOUS PAGE
JRST LKLOP5 ;DONE. GO CHECK IF FOUND ONE
LKLOP4: MOVE A,JFN ;THE FILE
MOVE B,MESSNO ;THE WORD TO START WITH
SFPTR ;SET FILE POINTER
JFCL ;SHOULD WORK
JRST UPTOP
FIND: CALL GETWD ;GET ANOTHER WORD
CAME B,[ASCII /=====/] ;TRAILER SEPERATOR
JRST FIND ;NO TRY NEXT WORD
CALL GETWD ;GET ANOTHER WORD
CAME B,[ASCIZ /=
/] ;LAST OF TRAILER
JRST FIND ;SOMEBODY MUST HAVE HAD ====== IN MSG.
FIND2: CALL GETWD ;GET ANOTHER WORD
JUMPE B,FIND2 ;IF NULL LOOK FOR NON-NULL
BKJFN ;BACK UP TO BEFORE NON-NULL WORD
MOVE A,JFN ;IGNORE ERROR SET UP JFN AGAIN
UPTOP: MOVEI B,7 ;CHANGE BYTE SIZE TO 7
SFBSZ
JFCL
RFPTR ;GET POSITION IN FILE
JRST NODSK
MOVEM B,BEGM ;SAVE IT
MOVSI B,(IT%AIS) ;REQUIRE SECONDS IN TIME OF MSG
IDTIM ;GET TIME STAMP OF MSG
SKIPA ;FAILED TRY BINARY
JRST TXTLP1 ;TEXT FORMAT FILE GO PROCESS
HRRZ A,JFN
MOVE B,BEGM ;GET START OF MESSAGE
SFPTR ;SET FILE POSITION
JRST NODSK
MOVEI B,44 ;THE BYTE SIZE TO LOOK AT POST MARKS
SFBSZ ;DO IT
JFCL ;??
CALL GETWD ;READ POST MARK
CAMGE B,TIME ;PRINT IT?
JRST FIND ;NO
;FOUND ONE TO DO
SKIPLE STOP ;WANT TO PAUSE?
CALL STOPW ;WAIT FOR GO AHEAD
NOSTOP: MOVSI A,(1B0)
ANDCAM A,STOP ;MAKE STOP POSITIVE
SKIPN PRUSE ;PERUSONG?
JRST MORE ;NO, GO DO NEXT
HRRZ A,JFN ;THE FILE ID
MOVEI B,7 ;THE DESIRED BYTE SIZE
SFBSZ ;SET IT TO THIS
JFCL ;IT SHOULD WORK
CALL DOPRSE ;YES. SO GO DO IT
HRRZ A,JFN
MOVEI B,44 ;THE BYTE SIZE TO LOOK AT POST MARKS
SFBSZ ;DO IT
JFCL ;??
JRST EMORE ;DO NOT PRINT REST OF MESSAGE
;GET WORD/CHARACTER FROM FILE AND TEST FOR EOF
GETWD: MOVE A,JFN ;GET INPUT JFN
BIN ;GET ANOTHER WORD/CHARACTER
JUMPN B,[ RET] ;GOOD DATA?
GTSTS ;NO. IS IT EOF?
TLNE B,1000 ;?
JRST DONE ;YES. WRAP IT UP
SETZM B ;RESTORE NULL IN B
RET ;RETURN
;LOOP TO READ IN ENTIRE TEXT OF MESSAGE
MORE: PUSHJ P,PRNLW ;PRINT UNTIL END OF MSG FOUND
EMORE: MOVE A,JFN
SKIPN PRUSE ;PERUSING?
JRST UPTOP ;GET NEXT
JRST FIND ;YES. SYNCH.
;PRINT UNTIL END OF MESSAGE IS FOUND
PRNLW: CALL GETWD ;GET ANOTHER WORD
CAMN B,[ASCII /=====/] ;TRAILER SEPERATOR
JRST PRNLW2 ;NO TRY NEXT WORD
PRNLW1: CALL PUTWD ;PUT WORD ON OUTPUT DEVICE
JRST PRNLW
PRNLW2: CALL PUTWD ;PUT WORD ON OUTPUT DEVICE
CALL GETWD ;GET ANOTHER WORD
CAME B,[ASCIZ /=
/] ;LAST OF TRAILER
JRST PRNLW1 ;SOMEBODY MUST HAVE HAD ====== IN MSG.
CALL PUTWD ;PUT WORD ON OUTPUT DEVICE
PRNLW3: CALL GETWD ;GET ANOTHER WORD
JUMPE B,PRNLW3 ;IF NULL LOOK FOR NON-NULL
BKJFN ;BACK UP TO BEFORE NON-NULL WORD
MOVE A,JFN ;IGNORE ERROR SET UP JFN AGAIN
POPJ P, ;YES, RETURN
;ROUTINE TO PUT A WORD OUT AS BYTE ON OJFN
PUTWD: MOVE A,OJFN ;OUTPUT JFN
MOVE D,B ;MOVE BYTE
HRROI B,D
MOVNI C,5 ;DO ALL FIVE BYTES
SOUT ;OUPUT TO TTY
EPRNLW: RET
;SUBROUTINE TO WAIT FOR GO AHEAD ON STOP
STOPW: PROMPT <[Type <CR> for more] >
CONFRM ;WAIT FOR CONFIRMATION
POPJ P, ;RETURN
;SUBROUTINE TO CLEAR MAP FOR BIGSTR
CLRSTR: SETO A,
MOVE B,[.FHSLF,,BIGSTR/1000]
SETZ C, ;ONLY ONE PAGE PLEASE
PMAP ;CLEAR MAP
RET ;AND DONE
;HERE WHEN FIRST WORD OF FILE IS FOUND TO BE NON-ZERO.
TXTFRM: MOVE A,JFN ;GET JFN BACK
HRLI A,(1B0) ;HAVE TO CLOSE AND REOPEN IT TO
CLOSF ; GET THE RIGHT LENGTHS
JRST OPNFAL ; CAN'T CLOSE IT?
HRRZ A,JFN ;RH ONLY
MOVE B,[070000,,200000] ;RE-OPEN IN SEVEN-BIT BYTES
SKIPE PRUSE ;DOING PERSUE ONLY?
TXO B,OF%PDT ;YES. SUPPRESS REFERENCE UPDATE
OPENF
JRST OPNFAL
SETO B, ;NOW SELECT EOF
SFPTR ; ..
JRST NODSK
RFPTR ;AND FIND WHERE EOF IS
JRST NODSK
MOVEM B,FILLEN ;UPDATE TO LENGTH OF FILE
MOVEI B,0 ;START OF FILE
SFPTR ;AND MOVE JFN POINTER BACK WHERE IT WAS
JRST NODSK
SETZM BEGM ;SAY AT BEGINING OF FILE
MOVSI B,(IT%AIS) ;REQUIRE SECONDS IN TIME OF MSG
IDTIM ;GET TIME STAMP OF MSG
JRST TXTOLY ;NOT TIME STAMP MUST BE TEXT FILE.
MOVEM B,THISDT ;SAVE DATE/TIME WORD
HRROI A