	.SYSID <	.TITLE MTDUMP >,< 000>
/
/COPYRIGHT (C) 1975
/DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/
/THIS SOFTWARE IS FURNISHED UNDER A LICENSE FOR USE ONLY
/ON A SINGLE COMPUTER SYSTEM AND MAY BE COPIED ONLY WITH
/THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS
/SOFTWARE, OR ANY OTHER COPIES THEREOF, MAY NOT BE PRO-
/VIDED OR OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON
/EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO
/THESE LICENSE TERMS.  TITLE TO AND OWNERSHIP OF THE
/SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.
/
/THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE
/WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COM-
/MITMENT BY DIGITAL EQUIPMENT CORPORATION.
/
/DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
/OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.
	.TITLE	MTDUMP EDIT'S
/PDP-9/15 MAG TAPE MULTIPLE-UTILITY PACKAGE, VERSION III.
/COPYRIGHT 1970 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
/EDIT #001;	OCT. 23,72
/	002	SK	13-NOV-73	CHANGE B2DPTR+9 FROM LAW -377 TO 376
/PETE WILSON  11-14-69
/	003	J. K.	22-MAY-74
/	CHANGE TO GETREC ROUTINE TO SET EOF BIT IN STATUS
/	WORD WHEN IT CALLS A ONE WORD RECORD AN EOF.
/
/MODIFIED  8-12-70 DAN MOREHEAD
/EDIT #004	EK	14-JUL-74	CHANGE SIGNON NUMBER
/#005	8/5/74	(RCHM)	ALLOW FILE STRUCTURED DUMP FILE PROCESSING TO
/			OCCUR PROPERLY
/#006	10-10-74 (RCHM)	KEEP THE FORMAT COMMAND FROM BOTCHING THE 9 CHANNEL
/			FOLLOWED BY/PROCEEDED BY A DENSITY COMMAND.
/#007	10-15-74 (RCHM)	INSTALL THE COMPARE COMMAND. COMPLETE DOCUMENTATION OF
/			THE USE OF THIS NEW COMMAND WILL BE FOUND IN THE COMMENTS
/			PRECEEDING THE COMMAND CODE.
/#008	10-21-74 (RCHM)	GENERAL COMMENTING AND LISTING CLEANUP.
/#009	10-21-74 (RCHM)	EXIT COMMAND WOULD NOT WORK PROPERLY. THIS WILL FIX IT.
/#010	10-21-74 (RCHM)	A CTRL P SHOULD NOT CLOSE THE DUMP FILE. THE DUMP FILE
/			SHOULD RETAIN AN IMAGE OF THE USER'S PROCESSING UP TO A
/			CLOSE COMMAND. THIS WILL ENABLE THIS.
/#011	10-28-74 (RCHM)	ADD CONDITIONALIZATION FOR ADSS TO ALLOW ON SOURCE UPDATING.
/#012	11-07-74 (RCHM)	IF THE RECORD READ FROM THE OLD MASTER EXACTLY FILLS THE
/			AVAILABLE BUFFER SPACE, THE RECORD READ FROM THE NEW MASTER WILL
/			WILL OVERLAY MTDUMP. THIS CODE WILL FIX THIS.
/#013	2-JAN-75 (JMW)	CHANGE HELLO TO V3B000.
/#014	01-17-74 (RCHM)	FIX MISSING MESSAGE FOR NOT ENOUGH CORE DURING COMPARE.
/ 015	30-JUL-75 (RCHM)	CHAING HELLO TO XVM TYPE.
	.SYSID <	.TITLE MTDUMP >,< 000>
/CULL ROUTINE IS NOT IMPLEMENTED IN THIS VERSION.
TTICAL=2776
TTOCAL=2775
BUFLEN=46
/IF PDP15 IS DEFINED AS A PARAMETER ASSIGNMENT, THE PDP-15
/PAGE MODE VERSION , AS NEEDED FOR V4E , WILL RESULT.
/IF PDP9 IS DEFINED AS A PARAMETER ASSIGNMENT, THE PDP-9
/BANK MODE VERSION , AS NEEDED FOR V4E , WILL RESULT.
/OTHERWISE THE PDP-15/20 (BANK/PAGE) VERSION , AS NEEDED FOR
/V5A , WILL BE GENERATED.
.DAT=135
.SCOM=100
SET=ISZ			/(RCHM-006) USET TO SET FLAGS NON-0
IDX=ISZ			/(RCHM-007) USED WHEN THE WORD BEING INCREMENTED CANNOT
			/(RCHM-007)  OVERFLOW. (PRODUCE A SKIP).
	.TITLE	MTDUMP ASSEMBLY PARAMETER PROCESSING.
 
/(RCHM-011)
/	THE FOLLOWING ASSEMBLY PARAMETERS ARE ALLOWED WITH MTDUMP
/
/	1. PDP9 & PDP15
/	   DO NOT USE THESE PARAMETERS. THE SYSTEM WILL NOT BE ASSEMBLED
/	   PROPERLY IF THESE ARE DEFINED.
/
/	2. ADSS
/	   IF THIS IS DEFINED, THE ADSS VERSION OF MTDUMP WILL BE PRODUCED.
/	   THE MAJOR CHANGE IS THE EXPECTED BLOCK SIZES FOR DIRECTORIED DEVICES.
/	   DOS IS 376, ADSS IS 377.
 
DOS=376				/(RCHM-011) SET UP FOR DOS FILE STRUCTURING.
	.IFDEF	ADSS		/(RCHM-011) SHOULD WE ASSEMBLE ADSS VERSION?
DOS=377				/(RCHM-011) ADSS FILE STRUCTURING BLOCK SIZE.
	.ENDC			/(RCHM-011)
	.TITLE	MTDUMP INITIALIZATION.
	.IODEV 1,3
INLIST	.INIT	3,1,RECOUP	/(RCHM-010) INIT THE DUMP FILE DAT SLOT.
P03DEV=INLIST+3
	LAW	-DOS		/(RCHM-011) FETCH FILE STRUCTURED DEVICE BUFFER SIZE.
	TAD	P03DEV		/(RCHM-010) +DEVICE BUFFER SIZE FROM INIT.
	SMA!CLA!CMA		/(RCHM-010) <0 => NOT FILE STRUCTURED.
	CLA			/(RCHM-010) SET UP TO FLAG FILE STRUCTURED, NOT OPEN.
	DAC	FILOPN		/(RCHM-010) SET UP FILE OPEN FLAG.
BEGIN	TTOCAL		/INITIALIZE TELETYPE.
ONE	1		/..
	RECOUP		/RETURN FROM CONTROL P.
LOOPCT	0		/TEMPORARY STORAGE.
POINTR=LOOPCT		/..
NMAPTR=LOOPCT
	.IFUND PDP9
	.IFDEF PDP15
	JMP SKPR
	.ENDC
	LAC* (.SCOM+23
	TAD (1
	DAC LODAT
	TAD (2
	DAC DATP03
	TAD (-5
	DAC DATM02
	LAC* (.SCOM+4
	AND (100
	SZA
	JMP OVER
SKPR	LAC (7777
	DAC MSKADR
	LAC (70000
	DAC MSKEPC
OVER=.
	.ENDC
/INITIALIZE ALL ENTRIES IN MAG TAPE DRIVE STATUS TABLE.
	DZM UNIT		/START WITH UNIT 0.
INITLP	JMS PUTDAT	/INSERT UNIT NUMBER IN DAT SLOT 1.
	.INIT 1,1,INITLP	/INITIALIZE THE DRIVE.
	LAC (100000	/BUMP UNIT NUMBER.
	TAD UNIT		/  BY ONE.
	DAC UNIT		/  ..
	SZA		/ALL DONE IF NEW DRIVE .E. 0.
	JMP INITLP	/MOVE UNITS TO INITIALIZE.
/ENTER LOOP TO SET DEFAULT FORMATS FOR ALL DRIVES.  IDEA HERE IS TO
/SET UP A TABLE (ONE ENTRY PER DRIVE) OF FORMAT-SPECIFYING .MTAPE CAL'S.
/THESE ENTRIES CAN BE MODIFIED BY "FORMAT" REQUESTS, WHICH ALSO
/(AFTER MODIFICATION) CAUSE THE PROPER .MTAPE TO BE ISSUED.
	LAC (16		/SET UP FIRST DEFAULT (7-TRACK, ODD, 800 BPI).
	DAC DRVTBL	/SAVE IT.
	LAC* (.SCOM+4	/NOW PICK UP .SCOM+4.
	AND (004000	/EXTRACT 9-CHANNEL INDICATOR (BIT 6).
	SZA		/SKIP IF 7-CHANNEL.
	ISZ DRVTBL	/9-CHANNEL, LET MTAPE = 17.
	LAC (DRVTBL	/NOW FIX UP A POINTER TO
	DAC DRVPTR	/  THE DRIVE FORMAT TABLE.
	LAW -10		/AND A COUNTER FOR
	DAC LOOPCT	/  EIGHT UNITS IN TABLE.
	LAC DRVTBL	/MOVE THE .MTAPE SUBFUNCTION
	CLL!RAL		/  INTO BITS 5-8.
	RTL
	RTL
	RTL
	RTL
	DAC DEFMT		/SAVE DEFAULT FORMAT.
DRVLP	DAC* DRVPTR	/PUT .MTAPE REQUEST INTO DRIVE TABLE.
	ISZ DRVPTR	/BUMP POINTER TO TABLE.
	ISZ LOOPCT	/AND COUNT ENTRIES COMPLETED.
	JMP DRVLP		/MORE TO DO, UPDATE NEXT ENTRY.
/PRINT START MESSAGE.
	LAW BEGMES	/"MTDUMP V3B000"
	JMS TYPOUT	/GO TYPE IT OUT.
/SET UP BUFFER ADDRESS AND SIZE.
	LAC* (.SCOM+2	/PICK UP .SCOM+2.
	DAC BUFADR	/THAT WILL BE ORIGIN OF MAGTAPE BUFFER.
	JMS TWOS		/NOW FORM TWO'S COMPLEMENT.
	TAD* (.SCOM+3	/SUBTRACT FROM .SCOM+3.
	CMA		/AND COMPLEMENT THE RESULT.
	DAC MAXWDS	/SAVE NEGATIVE TOTAL WORDS IN BUFFER AREA.
	JMS TWOS		/NOW MAKE A POSITIVE TOTAL AGAIN.
	JMS BTOD		/AND CONVERT IT FROM BINARY TO DECIMAL.
	DECNUM+5		/STORE DECIMAL NUMBER IN DECNUM...DECNUM+5.
	LAW 17762		/TERMINATE THE UNPACKED NUMBER
	DAC DECNUM+6	/  WITH A CARRIAGE RETURN.
	JMS MIXUP		/NOW GO COMBINE TWO MESSAGES:
	XCT BFSMES	/  "BUFSIZ:"
B2DPTR	0		/  POINTS TO THE FIRST CHARACTER OF NUMERIC STRING.
	LAW TYLINE	/THEN PRINT THE WHOLE MESSAGE
	JMS TYPOUT	/  ..
	LAC NOPLIT	/ALLOW ACCESS TO
	DAC OPEN		/  OPEN-DUMP-FILE SEQUENCE.
	DZM ECHOSW	/TURN ON VERIFY MODE (ECHO COMMAND LINES).
	LAW -1		/INITIALISE RADIX SW TO OCTAL
	DAC RADIX
	DZM MODISP	/SET DUMP MODE OCTAL.
	.TITLE	MAIN PROCESSING LOOP (COMMAND INPUT).
/ALL FINISHED WITH INITIALIZATION, ENTER MAIN PROCESSING LOOP FOR
/KEYBOARD COMMANDS.  IDEA HERE IS TO READ KEBOARD REQUEST AND
/CHECK FOR LEGALITY (LEGAL CONTROL WORDS APPEAR IN AN ASCII TABLE
/CALLED "CWDASC").  IF COMMAND IS NOT RECOGNIZED, PRINT A QUESTION MARK
/AND ACCEPT A NEW COMMAND.  IF COMMAND IS LEGAL, DISPATCH THROUGH
/A TABLE OF COMMAND-SERVICE ADDRESSES ("CWDTOP").
RDLIN	LAW RBRACK	/PICK UP ADDRESS OF RIGHT ANGLE BRACKET.
	JMS TYPOUT	/AND TYPE IT OUT.
	DZM QUIT		/INDICATE NO FILE PROCESSING GOING ON NOW.
	LAW TYLINE	/PICK UP INPUT-LINE-AREA ADDRESS.
	JMS TYPEIN	/AND READ NEXT REQUEST FROM TELETYPE.
	JMS UNPACK	/UNPACK THE TYPED LINE.
	TYLINE		/FROM TYLINE...
OUTADR	OUTLIN		/...TO OUTLIN.
	DAC TOCHRS	/SAVE FOR LATER
	TAD OUTADR	/CONSTRUCT A POINTER TO TERMINATOR OF TYPED LINE
	DAC POINTR	/  AS IT APPEARS IN THE UNPACKED ARRAY (OUTLIN).
ALTMOD	175\777777	/PICK UP REPRESENTATION OF ALT MODE
	SAD* POINTR	/DID USER ACTUALLY TYPE AN ALT MODE?
	JMS TYPRTN	/YES, GO PRINT CARRIAGE RETURN.
	LAC OUTADR	/OUTADR POINTS TO OUTLIN (WHERE TYPED LINE IS).
	DAC NXTPTR	/SET INITIAL POINTER IN NXTCHR.
	JMS GETCOM	/GO EXTRACT CONTROL WORD FROM INPUT LINE.
	LAW CWDTOP-CWDEND	/TOTAL ENTRIES IN CWD TABLE (2'S COMPLEMENT).
	DAC LOOPCT	/SET UP COUNT OF CONTROL WORDS TO EXAMINE.
	LAC CWDASC	/GET BEGINNING OF CONTROL WORD TABLE.
CWDLP1	DAC SCN1		/SET UP NEXT CALL TO UNPACK.
	JMS UNPACK	/UNPACK NEXT CONTROL WORD.
SCN1	0		/MODIFIED EACH TIME TO POINT TO NEW ENTRY.
	TYLINE		/USE TYLINE AS OUTPUT ARRAY.
	JMS SCAN		/COMPARE INPUT COMMAND WITH CURRENT ENTRY.
CWDLIT	CWD		/TYPED COMMAND IS IN CWD...CWD+7.
	TYLINE		/CURRENT TABLE ENTRY HAS JUST BEEN UNPACKED INTO TYLINE.
SKPLIT	SKP		/NO MATCH.
	SKP		/END STRING 1.
	JMP CWDLP2	/FAILED COMPARE, GET NEXT TABLE ENTRY.
	LAC* STR2		/POSSIBLE MATCH, GET NEXT WORD FROM TYLINE.
	SMA!CLL!CML	/MATCH IF NEXT WORD IN TYLINE IS NEGATIVE...
	SKP!CLA!RAL	/...OR IF TOTAL CHARS IN CWD .E. 1.
	JMP CWDISP	/FULL CONTROL WORD, GO DISPATCH.
	SAD NCHARS	/CHECK FOR ABBREVIATION (AC .E. 1 NOW).
	JMP CWDISP	/NCHARS .E. 1, GO DISPATCH.
CWDLP2	LAW -1		/MATCH FAILED, SET UP NEW ARG TO UNPACK...
	TAD* C12		/...USING A POINTER INTERNAL TO UNPACK.
	ISZ LOOPCT	/COUNT ENTRIES IN CONTROL WORD TABLE.
	JMP CWDLP1	/MORE TO DO, CONSIDER NEXT ENTRY.
/UNRECOGNIZED CONTROL WORD COMES HERE.
TYQUES	LAW QUESMK	/GET QUESTION MARK.
	JMS TYPOUT	/AND GO TYPE IT OUT.
	JMP RDLIN		/READ NEXT COMMAND.
CWDISP	LAC CWDEND	/GET END OF DISPATCH TABLE.
	TAD LOOPCT	/CALCULATE OUR CURRENT POSITION IN IT.
	DAC CWDXCT	/GIVE TO DISPATCHER.
/GO TO SERVICE SECTION FOR THIS CONTROL WORD.
CWDXCT	XX		/RESULTS IN XCT OF PROPER TABLE ENTRY (JMP OR JMS).
QUIT=CWDXCT		/QUIT .NE. 0, COMMAND PROCESSING IS IN PROGRESS.
	JMP RDLIN		/IN CASE TABLE ENTRY WAS A JMS.
	.TITLE	INITIALIZATION ERROR PROCESSORS.
/COME HERE ON REQUEST TO WRITE FILE-STRUCTURED DEVICE WHEN
/NO DUMP OUTPUT FILE IS OPEN.
NOFILE	LAW NOFILM
	JMS TYPOUT
	JMP RDLIN
NOFILM	ENDNFM-.*400+2
	0
	.ASCII 'NO DUMP FILE OPEN.'<15>
ENDNFM=.
/COME HERE ON ILLEGAL TERMINATOR FOUND IN COMMAND LINE.
ILLTRM	LAW ILTMES	/PICK UP ADDRESS OF COMPLAINT.
	JMS ERCOMT	/GO PUT IT OUT.
	JMP RDLIN		/AND READ NEXT REQUEST
ILTMES	ENDILT-.*400+2
	0
	.ASCII '*ILLEGAL TERMINATOR.'<15>
ENDILT=.
	.TITLE	ASCII COMMAND TABLE.
/ASCII COMMAND TABLE.  THIS IS THE SET OF LEGAL COMMANDS IN .ASCII
/FORMAT.  COMMANDS ARE TERMINATED WITH A CARRIAGE RETURN TO SATISFY
/THE REQUIREMENTS OF SUBROUTINE UNPACK.  COMMANDS WHICH MAY BE
/ABBREVIATED MUST PRECEDE OTHERS HAVING THE SAME INITIAL CHARACTER
/(THUS "COPY" PRECEDES "CLOSE").
CWDASC	.-1		/DEFINE TOP OF ASCII TABLE.
	.ASCII 'REWIND'<15>
NCHARS=.-1
	.ASCII 'TAPEMARK'<15>
	.ASCII 'BACKSPACE'<15>
	.ASCII 'SPACE'<15>
	.ASCII 'DUMP'<15>
	.ASCII 'COPY'<15>
	.ASCII 'COMPARE'<15>
	.ASCII 'OPEN'<15>
	.ASCII 'CLOSE'<15>
	.ASCII 'MODE'<15>
	.ASCII 'LIST'<15>
	.ASCII 'LOG'<15>
	.ASCII 'FORMAT'<15>
	.ASCII 'VERIFY'<15>
	.ASCII 'GET'<15>
	.ASCII 'PUT'<15>
	.ASCII 'SIZE'<15>
	.ASCII 'EXAMINE'<15>
	.ASCII 'NUMBER'<15>
	.ASCII 'DDUMP'<15>
	.ASCII 'DLIST'<15>
	.ASCII 'NEWDIR'<15>
	.ASCII 'EXIT'<15>
	.TITLE	COMMAND DISPATCH TABLE.
/THIS IS A TABLE OF DISPATCHERS TO CONTROL-WORD SERVICERS. ENTRIES
/MAY BE EITHER JMP'S OR JMS'S, AND THE ORDER OF THE ENTRIES MUST
/CORRESPOND TO THE ORDER OF COMMANDS IN THE ASCII TABLE ABOVE (E.G.,
/"SPACE" IS THE FOURTH COMMAND IN THE ASCII TABLE AND THE JMP TO
/THE SPACE-FORWARD SECTION IS THE FOURTH ENTRY IN THE DISPATCH TABLE.
CWDTOP	JMP REWIND	/REWIND U
	JMP WRTEOF	/TAPEMARK U
	JMP BKSPCE	/BACKSPACE U,N
	JMP SPCFWD	/SPACE U,N
	JMP DUMP		/DUMP U,N
	JMP COPY		/COPY U1,U2,T
	JMP	COMPARE		/(RCHM-007) GO PROCESS COMPARE COMMAND.
	JMP OPEN		/OPEN FILNAM EXT
	JMP CLOSE		/CLOSE
	JMP MODE		/MODE XYZ
	JMP LIST		/LIST U,N
	JMP PRCOMT	/LOG
	JMP FORMAT	/FORMAT
	JMP VERIFY	/VERIFY ON; VERIFY OFF
	JMP GET		/GET U
	JMP PUT		/PUT U
	JMP SIZE		/SIZE
	JMP EXAMNE	/EXAMINE
	JMP NUMBER	/NUMBER OCT; NUMBER DEC
	JMP DDUMP		/DDUMP U
	JMP DLIST		/DLIST U
	JMP NUDIRC	/NEWDIR U
	JMP EXIT		/EXIT
CWDEND	XCT CWDEND
	.TITLE	COMMAND PROCESSORS.
	.TITLE		COMPARE COMMAND PROCESSOR.
 
/(RCHM-007)
/ THIS COMMAND IS USED TO COMPARE ALL OR ANY PORTION OF TWO TAPES TOGETHER.
/ COMPARISON WILL PROCEED UNDER ALL BUT THE FOLLOWING CONDITIONS.
/
/	1. UNEXPECTED EOF DETECTED ON EITHER TAPE. (EOF'S NOT FOUND IN THE
/	   SAME PLACE)
/
/	2. UNEXPECTED PHYSICAL EOT ENCOUNTERED.
/
/	3. TERMINAL CONDITION AS SPECIFIED BY THE USER IS MET.
 
/ THE INPUT TO TIS COMMAND IS OF THE FORM:
/
/	COMPARE U1,U2,TC
/
/ WHERE U1=ORIGIONAL TAPE (OLD MASTER).
/	U2=TAPE TO BE COMPARED (NEW MASTER).
/	TC=TERMINATING CONDITION UNDER WHICH THE COMPARE PROCESS IS TO BE STOPPED.
/	   THE TERMINAL CONDITIONS THE USER MAY SPECIFY ARE:
/	   1. EOF: ONE EOF ON THE NEW MASTER WILL CAUSE TERMINATION.
/	   2. EOT: TWO CONSECUTIVE EOF'S ON THE NEW MASTER WILL CAUSE TERMINATION.
/	   3. NNN: AFTER NNN RECORDS, THE COMPARISON WILL STOP.
/
/ THE INPUTS MUST BE SPECIFIED AS ALL OTHER INPUTS TO MTDUMP ARE SPECIFIED.
/ ANYTHING ENTERED WHICH DOES NOT MEET THE SPECIFICATIONS WILL BE IGNORED.
 
/ FETCH ARGUMENTS OF THE COMPARE COMMAND AND INITIALIZE ALL NECESSARY
/ FLAGS AND VARIABLES FOR THE OPERATION OF THE COMPARE PROCESS.
 
COMPARE	JMS	GETDRV		/(RCHM-007) FETCH UNIT # OF OLD MASTER TAPE.
	JMP	TYQUES		/(RCHM-007) INVALID UNIT # ENTERED.
	DAC	UNIT1		/(RCHM-007) SAVE OLD MASTER UNIT #.
	JMS	GETDRV		/(RCHM-007) FETCH UNIT # OF NEW MASTER TAPE.
	JMP	TYQUES		/(RCHM-007) INVALID UNIT # ENTERED.
	DAC	UNIT2		/(RCHM-007) SAVE NEW MASTER UNIT #.
	JMS	ECHO		/(RCHM-007) PRINT COMMAND ON DUMP FILE.
	JMS	GETARG		/(RCHM-007) SET UP TERMINATING CONDITION (TC).
 
/ INITIALIZE CONSTANTS AND FLAGS FOR COMPARE.
 
	DZM	CMBCNT		/(RCHM-007) CLEAR BLOCK COUNTER.
	DZM	CMERR		/(RCHM-007) CLEAR ERROR FLAG.
	DZM	CMEOT		/(RCHM-007) CLEAR EOT FLIP FLOP.
	DZM	CMEOF		/(RCHM-007) CLEAR EOF FLIP FLOP.
	LAC	BUFADR		/(RCHM-007) SAVE SA OF BUFFER SET UP BY MTDUMP
				/(RCHM-007)  UPON INITIALIZATION.
	DAC	CMBUF1		/(RCHM-007) SAVE BUFFER SA FOR READ OF OLD MASTER.
	LAC	MAXWDS		/(RCHM-007) SAVE OLD MAXWORDS FOR RESTORING.
	DAC	CMMXWD		/(RCHM-007) GETS ALTERED BY N.M. READ.
 
/(RCHM-007)
/ AT THIS POINT WE ARE READY TO READ THE OLD MASTER TO FETCH A BLOCK FOR
/ THE COMPARE AGAINST THE NEW MASTER.
 
CM0010	LAC	UNIT1		/(RCHM-007) FETCH OLD MASTER UNIT #.
	DAC	UNIT		/(RCHM-007) MAKE OLD MASTER CURRENT UNIT.
	JMS	PUTDAT		/(RCHM-007) MAKE .DAT SLOT #1 ACCESS OLD MASTER.
	LAC	CMBUF1		/(RCHM-007) FETCH SA OF BUFFER.
	DAC	BUFADR		/(RCHM-007) SET UP .TRAN FOR INPUT OF OLD MASTER BLOCK.
	LAC	CMMXWD		/(RCHM-007) MAXIMUN NUMBER OF WORDS FOR READ.
	DAC	MAXWDS		/(RCHM-007) STORE IT IN .TRAN TO DETECT LONG RECORD.
	JMS	GETREC		/(RCHM-007) FETCH A BLOCK FROM THE OLD MASTER.
	JMP	CMEOF1		/(RCHM-007) EOF ENCOUNTERED ON OLD MASTER.
	JMP	CMEOT1		/(RCHM-007) PHYSICAL EOT ENCOUNTERED ON OLD MASTER.
	JMP	CMNECM		/(RCHM-007) RECORD TOO LONG. TELL USER AND EXIT.
	LAC	COUNT		/(RCHM-007) FETCH LENGTH OF OLD MASTER BLOCK.
	DAC	CMBUFC		/(RCHM-007) SAVE LENGTH FOR COMPARISION AFTER NEW
				/(RCHM-007)  MASTER READ.
	TAD	CMBUF1		/(RCHM-007) CALCULATE SA OF NEW MASTER BUFFER.
	DAC	BUFADR		/(RCHM-007) SET UP INPUT .TRAN FROM NEW MASTER.
	LAC	COUNT		/(RCHM-007) NUMBER OF WORDS OCCUPIED BY O.M. BLOCK.
	TAD	CMMXWD		/(RCHM-007) - NUMBER OF WORDS AVAILABLE IN CORE.
	DAC	MAXWDS		/(RCHM-007) STORE NEW COUNT IN .TRAN FOR N.M.
	SNA			/(RCHM-012) DID THE RECORD FROM THE OLD MASTER EXACTLY
				/(RCHM-012)  THE AVAILABLE BUFFER SPACE?
	JMP	CMNECM		/(RCHM-012) THERE IS NO SPACE FOR THE BLOCK FROM THE
				/(RCHM-012)  NEW MASTER.
 
/(RCHM-007)
/ AT THIS POINT WE ARE READY TO READ THE NEW MASTER TAPE TO GET A COMPARISON
/ RECORD. CMEOT1 AND CMEOF1 RETURN HERE SINCE THE NEXT RECORD READ SHOULD
/ BE AN END OF FILE OR AN END OF TAPE.
 
CM0020	LAC	UNIT2		/(RCHM-007) MAKE THE NEW MASTER UNIT THE CURRENT UNIT.
	DAC	UNIT		/(RCHM-007) CURRENT UNIT #.
	JMS	PUTDAT		/(RCHM-007) MAKE .DAT SLOT #1 ACCESS NEW MASTER.
	JMS	GETREC		/(RCHM-007) FETCH RECORD FROM NEW MASTER.
	JMP	CMEOF2		/(RCHM-007) EOF ENCOUNTERED ON NEW MASTER.
	JMP	CMEOT2		/(RCHM-007) PHYSICAL EOT ENCOUNTERED ON NEW MASTER.
	JMP	CMNEC		/(RCHM-007) LONG RECORD, TELL USER.
 
/(RCHM-007)
/ BEGIN COMPARISON PROCESS, THE ORDER OF CHECKS IS:
/	1. CHECK FOR MISSING EOF
/	2. CHECK FOR MISSING EOT.
/	3. CHECK FOR DIFFERING BLOCK LENGTHS.
/	4. MAKE WORD COMPARISON BETWEEN BLOCKS.
/
/ THE FIRST TWO CHECKS ARE FATAL IF DETECTED. THE LAST TWO ALLOW COMPARISON
/ TO CONTINUE.
 
	LAC	CMEOF		/(RCHM-007) EXPECTED EOF NOT ENCOUNTERED?
	SZA			/(RCHM-007) NO, PROCEED WITH CHECKING.
	JMP	CMUEF1		/(RCHM-007) GO TERMINATE PROCESSING PROPERLY.
	LAC	CMEOT		/(RCHM-007) EXPECTED PHYSICAL EOT NOT ENCOUNTERED?
	SZA			/(RCHM-007) NO, PROCEED WITH CHECKING.
	JMP	CMUET1		/(RCHM-007) GO TERMINATE PROCESSING PROPERLY.
	LAC	COUNT		/(RCHM-007) FETCH CURRENT (NEW MASTER) BLOCK LENGTH.
	SAD	CMBUFC		/(RCHM-007) COMPARE AGAINST OLD MASTER BLOCK LENGTH.
	SKP			/(RCHM-007) THEY ARE OK.
	JMP	CMWCNE		/(RCHM-007) BLOCK LENGTH'S NOT EQUAL, TELL USER AND SELECT
				/(RCHM-007)  SHORTEST BLOCK LENGTH FOR COMPARE.
 
/(RCHM-007)
/ PREPARE FOR COMPARISON LOOP. IF A LENGTH COMPARE ERROR HAS OCCURED, THIS
/ SECTION WILL BE ENTERED WITH THE SHORTEST BLOCK LENGTH IN THE AC.
 
CM0040	JMS	TWOS		/(RCHM-007) CONVERT WC TO NEGATIVE NUMBER.
	DAC	CMBUFC		/(RCHM-007) SAVE FOR LOOP TERMINATION.
	LAC	CMBUF1		/(RCHM-007) FETCH SA OF BUFFER (OLD MASTER BLOCK).
	DAC	CMBUFP		/(RCHM-007) POINTER TO OLD MASTER BUFFER.
	DZM	CMWC		/(RCHM-007) RESET WORD ID COUNTER (USED BY ERROR ROUTINES).
CM0050	LAC*	CMBUFP		/(RCHM-007) FETCH WORD FROM OLD MASTER.
	IDX	CMWC		/(RCHM-007) BUMP WORD ID NUMBER.
	SAD*	BUFADR		/(RCHM-007) COMPARE AGAINST NEW MASTER.
	SKP			/(RCHM-007) EQUAL, SKIP.
	JMP	CMWNE		/(RCHM-007) WORDS IN BUFFERS ARN'T THE SAME.
CM0060	IDX	CMBUFP		/(RCHM-007) INCREMENT TO NEXT WORD OF OLD MASTER BUFFER.
	IDX	BUFADR		/(RCHM-007) INCREMENT TO NEXT WORD OF NEW MASTER BUFFER.
	ISZ	CMBUFC		/(RCHM-007) DONE WITH COMPARISON YET?
	JMP	CM0050		/(RCHM-007) NO.
 
/(RCHM-007)
/ COMPARISON IS COMPLETE, INCREMENT BLOCK COUNTER FOR THE NEXT BLOCK
/ AND CHECK TO SEE IF THE COMPARISON OF THE TAPES IS COMPLETE.
 
CM0070	IDX	CMBCNT		/(RCHM-007) INCREMENT BLOCK NUMBER.
	JMS	CHKTRM		/(RCHM-007) ARE WE DONE WITH COMPARE?
	JMP	CM0010		/(RCHM-007) NOT YET, GO PROCESS ANOTHER BLOCK.
CMEXTA	LAC	CMERR		/(RCHM-007) DID A NON FATAL ERROR OCCUR DURING
				/(RCHM-007)  THE COMPARE EXECUTING.
	SNA			/(RCHM-007) YES, TELL USER.
	JMP	CMNOER		/(RCHM-007) NO, TELL USER TAPES ARE IDENTICAL.
	LAW	MESS1		/(RCHM-007) FETCH ADDRESS OF MESS1 FOR ERCOMT
CMEXIT	JMS	ERCOMT		/(RCHM-007) PLACE TERMINATING MESSAGE IN BOTH DUMP FILE
				/(RCHM-007)  AND TELEPRINTER FILE.
	LAC	CMBUF1		/(RCHM-007) RESTORE SA OF BUFFER TO .TRAN.
	DAC	BUFADR		/(RCHM-007) RESTORE .TRAN TO INITIAL VALUE.
	LAC	CMMXWD		/(RCHM-007) RESTORE MAXIMUM WORD COUNT FOR .TRAN
	DAC	MAXWDS		/(RCHM-007) SET UP INPUT TRAN AGAIN.
	JMP	RDLIN		/(RCHM-007) GO GET NEXT COMMAND.
CMNOER	LAW	MESS2		/(RCHM-007) TAPES ARE IDENTICAL.
	JMP	CMEXIT		/(RCHM-007) GO GET NEXT COMMAND.
	.TITLE			COMPARE ERROR PROCESSORS.
 
/(RCHM-007)
/ ALL COMPARE ERRORS, RECOVERABLE AND OTHERWISE, ARE PROCESSED HERE.
 
 
/ EOF DETECTED ON OLD MASTER, SET UP FOR COMPARISON AND
/ GO READ NEW MASTER.
 
CMEOF1	LAC	CMEOF		/(RCHM-007) PREPARE TO FLIP EOF FLAG.
	CMA			/(RCHM-007) SET TO EOF ENCOUNTERED ON OLD MASTER.
	DAC	CMEOF		/(RCHM-007) EOF ENCOUNTERED.
	JMP	CM0020		/(RCHM-007) GO READ NEW MASTER.
 
/ PHYSICAL EOT DETECTED ON OLD MASTER, SET UP FOR COMPARISON AND GO READ
/ NEW MASTER.
 
CMEOT1	LAC	CMEOT		/(RCHM-007) PREPARE TO FLIP EOT FLAG.
	CMA			/(RCHM-007) FLIP EOT FLAG.
	DAC	CMEOT		/(RCHM-007) PHYSICAL EOT ENCOUNTERED ON OLD MASTER.
	JMP	CM0020		/(RCHM-007) GO READ NEW MASTER.
 
/ NOT ENOUGH CORE TO CONTAIN THE EXPECTED BUFFERS. THIS CONDITION IS TERMINAL
/ AND CANNOT BE RECOVERED FROM.
 
/ NOT ENOUGH CORE AFTER READING OLD MASTER (O.M.)  SPACE NEW MASTER FORWARD ONE BLOCK
/ AND TERMINATE.
 
CMNECM	LAC	UNIT2		/(RCHM-007) FETCH N.M. TAPE DRIVE.
	DAC	UNIT		/(RCHM-007) MAKE N.M CURRENT UNIT.
	JMS	PUTDAT		/(RCHM-007) SET UP .DAT +1 FOR FORWARD SPACE.
	.MTAPE	1,5		/(RCHM-007) FORWARD SPACE THE NEW MASTER.
 
/ NOT ENOUGH CORE AFTER READING NEW MASTER (N.M.) FORWARD SPACE OF N.M NOT
/ NECESSARY.
 
CMNEC	LAC	RADIX		/(RCHM-007) DETERMINE CURRENT RADIX
	SZA			/(RCHM-007) CONVERT TO DECIMAL IF AC=0.
	JMP	CM0072		/(RCHM-007) OTHERWISE CONVERT TO OCTAL.
	LAC	CMBCNT		/(RCHM-007) FETCH CURRENT BLOCK NUMBER.
	JMS	BTOD		/(RCHM-007) CONVERT NUMBER TO DECIMAL FORMAT.
	DECNUM+5		/(RCHM-007) LOW ORDER DIGIT POSITION.
	DAC	CM0076		/(RCHM-007) STORE SA OF CONVERTED NUMBER IN MIXUP ARGUMENT
				/(RCHM-007)  LIST.
	JMP	CM0074		/(RCHM-007) GO PRINT ERROR MESSAGE.
CM0072	LAC	CMBCNT		/(RCHM-007) FETCH BLOCK # FOR CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT BLOCK # TO OCTAL.
	DECNUM			/(RCHM-007) SA FOR CONVERSION OUTPUT.
	LAC	.-1		/(RCHM-007) FETCH ADDRESS OF CONVERSION OUTPUT BUFFER.
	DAC	CM0076		/(RCHM-007) STORE SA OF CONVERTED NUMBER IN MIXUP ARGUMENT
				/(RCHM-007)  LIST.
CM0074	LAW	17602		/(RCHM-007) FETCH -ALTMODE FOR BLOCK NUMBER TERMINATOR.
	DAC	DECNUM+6	/(RCHM-007) STORE TURMINATOR FOR MIXUP.
	JMS	MIXUP		/(RCHM-007) COMBINE MESSAGES.
	XCT	MESS8-2		/(RCHM-007) BLOCK #.
CM0076	XX			/(RCHM-007) ADDRESS OF BLOCK NUMBER BUFFER.
	XCT	MESS3-2		/(RCHM-007) NOT ENOUGH CORE FOR COMPARISON BUFFERS.
	LAW TYLINE		/(RCHM-014) FETCH ADDRESS OF MESSAGE BUFFER.
	JMS TYPOUT		/(RCHM-014) PRINT INSUFFICIENT CORE MESSAGE ALWAYS ON
				/(RCHM-014)  MAIN CONSOLE.
	JMP	CMEXTA		/(RCHM-007) GO READ NEXT COMMAND.
 
/ EOF DETECTED ON NEW MASTER. MAKE SURE ONE SHOULD EXIST ON IT AND RETURN
/ TO CCOUNT BLOCKS IF IT SHOULD.
 
CMEOF2	LAC	CMEOF		/(RCHM-007) EOF FLAG NON-ZERO IF LAST RECORD OF OLD MASTER
				/(RCHM-007)  WAS EOF.
	SNA			/(RCHM-007) EVERYTHING OK, EOF WAS EXPECTED.
	JMP	CMUEF2		/(RCHM-007) UNEXPECTED EOF ENCOUNTERED ON NEW MASTER.
	CMA			/(RCHM-007) FLOP EOF FLAG.
	DAC	CMEOF		/(RCHM-007) RESTORE EOF FLAG.
	JMP	CM0070		/(RCHM-007) GO COUNT BLOCKS, EOF IS A BLOCK.
 
/ UNEXPECTED EOF ENCOUNTERED ON NEW MASTER. TELL THE USER AND EXIT.
 
CMUEF2	JMS	MIXUP		/(RCHM-007) MOVE TERMINAL MESSAGE TO DUMP FILE.
	XCT	MESS4-2		/(RCHM-007) UNEXPT. EOF ON N.M.
CMERXT	JMS	WRFILE		/(RCHM-007) DUMP ERROR MESSAGE INTO DUMP FILE.
	CLA!CMA			/(RCHM-007) SET UP ERROR FLAG.
	DAC	CMERR		/(RCHM-007) FLAG ERROR.
	JMP	CMEXTA		/(RCHM-007) TELL THE USER ABOUT THE ERROR.
 
/ PHYSICAL EOT ENCOUNTERED ON NEW MASTER. SEE IF IT WAS EXPECTED. IF IT
/ WAS, CONTINUE PROCESSING.
 
CMEOT2	LAC	CMEOT		/(RCHM-007) EOT FLAG NON-ZERO IF LAST BLOCK OF NEW MASTER
				/(RCHM-007)  WAS EOT.
	SNA			/(RCHM-007) EVERYTHING OK, EOT WAS EXPECTED.
	JMP	CMUET2		/(RCHM-007) UNEXPECTED EOT ON NEW MASTER.
	CMA			/(RCHM-007) FLOP EOT FLAG.
	DAC	CMEOT		/(RCHM-007) RESTORE EOT FLAG.
	JMP	CM0070		/(RCHM-007) GL COUNT BLOCKS, EOT IS A BLOCK.
 
/ UNEXPECTED PHYSICAL EOT HAS BEEN ENCOUNTERED ON NEW MASTER. TELL USER
 
CMUET2	JMS	MIXUP		/(RCHM-007) MOVE MESSAGE TO TYLINE.
	XCT	MESS5-2		/(RCHM-007) UNEX. EOT ON N.M.
	JMP	CMERXT		/(RCHM-007) TAKE ERROR EXIT.
 
/ EXPECTED EOF ON NEW MASTER NOT ENCOUNTERED.
 
CMUEF1	JMS	MIXUP		/(RCHM-007) MOVE MESSAGE TO TYLINE.
	XCT	MESS6-2		/(RCHM-007) EXPECT EOF NOT ON N.M.
	JMP	CMERXT		/(RCHM-007) TAKE ERROR EXIT.
 
/ EXPECTED PHYSICAL EOT ON NEW MSTER NOT ENCOUNTERED.
 
CMUET1	JMS	MIXUP		/(RCHM-007) MOVE MESSAGE TO TYLINE.
	XCT	MESS7-2		/(RCHM-007) EXPECTED EOT NO ON N.M.
	JMP	CMERXT		/(RCHM-007) TAKE ERROR EXIT.
 
/ NON FATAL ERROR. BLOCK LENGTHS ARE NOT EQUAL, RETURN TO COMPARISON LOOP
/ WITH SHORTEST BLOCK LENGTH IN AC.
 
CMWCNE	LAW	17602		/(RCHM-007) SET UP ALT MODE IN BUFFER.
	DAC	DECNUM+6	/(RCHM-007) ALTMODE FOR TERMINATOR.
	LAC	RADIX		/(RCHM-007) FETCH CURRENT RADIX.
	SZA			/(RCHM-007) CONVERT TO DECIMAL IF AC=0.
	JMP	CM0080		/(RCHM-007) OTHERWISE CONVERT TO OCTAL.
	LAC	CMBCNT		/(RCHM-007) FETCH FAILING BLOCK NUMBER.
	JMS	BTOD		/(RCHM-007) CONVERT BLOCK # TO DECIMAL.
	DECNUM+5		/(RCHM-007) LOW ORDER DIGIT ADDRESS.
	JMP	CM0090		/(RCHM-007) GO CREATE COMBINED MESSAGE.
CM0080	LAC	CMBCNT		/(RCHM-007) FETCH BLOCK # FOR OCTAL CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT TO ASCII.
	DECNUM			/(RCHM-007) CONVERSION OUTPUT BUFFER.
	LAC	.-1		/(RCHM-007) FETCH CONVERSION BUFFER SA FOR MIXUP.
CM0090	DAC	CM0100		/(RCHM-007) STORE IN MIXUP ARGUMENT LIST.
	JMS	MIXUP		/(RCHM-007) PRINT BLOCK # XXXXXX.
	XCT	MESS8-2		/(RCHM-007)
CM0100	XX			/(RCHM-007) CONVERT BLOCK # SA.
	XCT	MESS13-2		/(RCHM-007) LENGTHS NOT EQUAL.
	LAW	-1		/(RCHM-007) FETCH ERROR FLAG.
	DAC	CMERR		/(RCHM-007) SET ERROR OCCURED FLAG.
	JMS	WRFILE		/(RCHM-007) PLACE COMBINED LINE IN DUMP FILE.
 
/ SORT OUT SHORTEST BLOCK LENGTH FOR RETURN TO COMPARE LOOP.
 
	LAC	COUNT		/(RCHM-007) DECIDE WHICH BLOCK IS SHORTEST.
	JMS	TWOS		/(RCHM-007) CONVERT NEW MASTER BLOCK LENGTH TO NEGATIVE
				/(RCHM-007)  NUMBER.
	TAD	CMBUFC		/(RCHM-007) ADD OLD MASTER BLOCK LENGTH.
	RAL			/(RCHM-007) CAN'T BE ZERO, SO SAVE SIGN IN LINK.
	LAC	COUNT		/(RCHM-007) FETCH LENGTH OF NEW MASTER BLOCK.
	SZL			/(RCHM-007) WAS IT THE SHORTEST?
	LAC	CMBUFC		/(RCHM-007) NO, OLD MASTER BLOCK WAS SHORTER.
	JMP	CM0040		/(RCHM-007) GO PERFORM COMPARISON.
 
/ WORDS IN BUFFER ARE NOT EQUAL. DESCRIBE BLOCK, WORD NUMBER, AND WORDS
/ IN THE DUMP FILE AND CONTINUE PROCESSING OF THE BUFFER.
 
CMWNE	LAW	17602		/(RCHM-007) ALT MODE TERMINATOR FOR MIXUP
	DAC	DECNUM+6	/(RCHM-006) STORE TERMINATOR FOR BLOCK NUMBER
	DAC	TYLINE+6	/(RCHM-006) STORE TERMINATOR FOR WORD NUMBER
	DAC	TYLINE+16	/(RCHM-006) STORE TERMINATOR FOR WORD FROM OLD MASTER.
	DAC	TYLINE+26	/(RCHM-006) STORE TERMINATOR FOR WORD FROM NEW MASTER.
	LAC	RADIX		/(RCHM-007) PREPARE TO CONVERT BLOCK # AND WORD # TO
				/(RCHM-007)  CURRENT RADIX.
	SZA			/(RCHM-007) PERFORM DECIMAL CONVERSION IF AC=0.
	JMP	CM0110		/(RCHM-007) PERFORM OCTAL CONVERSION OTHERWISE.
	LAC	CMBCNT		/(RCHM-007) FETCH BLOCK # FOR CONVERSION.
	JMS	BTOD		/(RCHM-007) CONVERT BLOCK # TO DECIMAL.
	DECNUM+5		/(RCHM-007) LOW ORDER DIGIT ADDRESS.
	DAC	CM0130		/(RCHM-007) STORE ADDRESS IN MIXUP ARGUMENT LIST.
	LAC	CMWC		/(RCHM-007) FETCH WORD COUNT FOR CONVERSION.
	JMS	BTOD		/(RCHM-007) CONVERT WORD # TO DECIMAL.
	TYLINE+5		/(RCHM-007) LOW ORDER DIGIT ADDRESS.
	JMP	CM0120		/(RCHM-007) PRODUCE COMBINED MESSAGE.
CM0110	LAC	CMBCNT		/(RCHM-007) FETCH BLOCK # FOR CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT BLOCK # TO IMAGE ASCII.
	DECNUM			/(RCHM-007) CONVERSION OUTPUT AREA.
	LAC	.-1		/(RCHM-007) FETCH CONVERSION BUFFER ADDRESS.
	DAC	CM0130		/(RCHM-007) STORE ADDRESS IN MIXUP ARGUMENT LIST.
	LAC	CMWC		/(RCHM-007) FETCH WORD # FOR CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT WORD # TO IMAGE ASCII.
	TYLINE			/(RCHM-007) CONVERSION OUTPUT AREA.
	LAC	.-1		/(RCHM-007) FRTCH CONVERSION BUFFER ADDRESS.
CM0120	DAC	CM0140		/(RCHM-007) STORE IN MISUP ARGUMENT LIST.
				/(RCHM-007)  FOR CONVERSION.
	LAC*	CMBUFP		/(RCHM-007) FETCH O.M. WORD FOR CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT WORD1 TO IMAGE ASCII.
	TYLINE+10		/(RCHM-007) CONVERSION OUTPUT AREA.
	LAC*	BUFADR		/(RCHM-007) FETCH WORD FROM NEW MASTER BUFFER
				/(RCHM-007)  FOR CONVERSION.
	JMS	BTOA		/(RCHM-007) CONVERT WORD2 TO IMAGE ASCII.
	TYLINE+20		/(RCHM-007) CONVERSION OUTPUT AREA
 
/ COMBINE IOPS AND IMAGE ASCII MESSAGES INTO OUTPUT MESSAGE.
 
	JMS	MIXUP		/(RCHM-007) COMBINE DATA INTO MESSAGE.
	XCT	MESS8-2		/(RCHM-007) BLOCK # 
CM0130	XX			/(RCHM-007) ADDRESS OF CONVERSION BUFFER.
	XCT	MESS10-2	/(RCHM-007) WORD #
CM0140	XX			/(RCHM-007) ADDRESS OF WORD # CONVERSION BUFFER.
	XCT	MESS11-2	/(RCHM-007) ORIG. WORD
	CAL	TYLINE+10	/(RCHM-007) XXXXXX
	XCT	MESS12-2	/(RCHM-007) COMP. WORD 
	CAL	TYLINE+20	/(RCHM-007) XXXXXX
	LAW	-1		/(RCHM-007) FETCH ERROR FLAG (ALSO END OF ARGUMENT LIST)
	DAC	CMERR		/(RCHM-007) FLAG NON-FATAL ERROR.
	JMS	WRFILE		/(RCHM-007) GO WRITE LINE TO DUMP FILE.
	JMP	CM0060		/(RCHM-007) GO SET UP FOR NEXT WORD.
	.TITLE			COMPARE VARIABLES.
CMBCNT	0			/(RCHM-007) BLOCK COUNTER. NUMBER OF BLOCKS READ
				/(RCHM-007)  DURING COMPARISON PROCESS. COUNT
				/(RCHM-007)  PROCEEDS FROM 0.
CMBUFC	0			/(RCHM-007) NUMBER OF WORDS IN OLD MASTER BLOCK.
				/(RCHM-007)  ALSO NUMBER OF WORDS TO COMPARE BETWEEN BUFFERS.
CMBUFP	0			/(RCHM-007) POINTER TO OLD MASTER BUFFER DURING WORD
				/(RCHM-007)  COMPARE.
CMBUF1	0			/(RCHM-007) SA OF COMPARISON BUFFERS, FIRST FREE WORD
				/(RCHM-007)  OF CORE.
CMEOF	0			/(RCHM-007) 0 IF EOF'S OK, -1 IF EOF DETECTED
				/(RCHM-007)  ON OLD MASTER BUT NOT ON NEW YET.
CMEOT	0			/(RCHM-007) SAME AS ABOVE BUT FOR PHYSICAL END OF
				/(RCHM-007)  TAPE.
CMERR	0			/(RCHM-007) ERROR FLAG 0 IF NO ERRORS.
CMWC	0			/(RCHM-007) WORD COUNTER. SIMILAR TO CMBCNT BUT
				/(RCHM-007)  DURING WORD COMPARE LOOP.
CMMXWD	0			/(RCHM-007) MAXIMUM NUMBER OF WORDS AVAILABLE FOR
				/(RCHM-007)  READ OF OLD MASTER TAPE.
	.TITLE			COMPARE MESSAGES.
MESS13	.ASCII	" LENGTHS NOT EQUAL"<15> /(RCHM-007)
MESS12	.ASCII	"  N.M. WORD -- "<15> /(RCHM-007)
MESS11	.ASCII	"  O.M. WORD -- "<175> /(RCHM-007)
MESS10	.ASCII	"  WORD # "<175>	/(RCHM-007)
MESS8	.ASCII	"BLOCK # "<175> /(RCHM-007)
MESS7	.ASCII	"EXPECTED END OF TAPE NOT ENCOUNTERED ON NEW MASTER"<15> /(RCHM-007)
MESS6	.ASCII	"EXPECTED END OF FILE NOT ENCOUNTERED ON NEW MASTER"<15> /(RCHM-007)
MESS5	.ASCII	"UNEXPECTED END OF TAPE ENCOUNTERED ON NEW MASTER"<15> /(RCHM-007)
MESS4	.ASCII	"UNEXPECTED END OF FILE ENCOUNTERED ON NEW MASTER"<15> /(RCHM-007)
MESS3	.ASCII	" NOT ENOUGH CORE FOR COMPARISON BUFFERS"<15> /(RCHM-007)
MESS2	MESS1-MESS2/2*1000	/(RCHM-007)
	0			/(RCHM-007)
	.ASCII	"TAPES ARE IDENTICAL"<15> /(RCHM-007)
MESS1	MESS0-MESS1/2*1000	/(RCHM-007)
	0			/(RCHM-007)
	.ASCII	"ERRORS DETECTED DURING COMPARISON"<15> /(RCHM-007)
MESS0=.			/(RCHM-007)
	.TITLE		REWIND COMMAND PROCESSOR.
REWIND	JMS ECHO		/PUT COMMAND INTO DUMP OUTPUT FILE.
	JMS GETDRV	/WHAT UNIT SHOULD BE REWOUND?
	JMP TYQUES	/NO UNIT GIVEN.
	JMS PUTDAT	/PUT UNIT NUMBER IN DAT SLOT 1.
	.MTAPE 1,0	/THEN REQUEST REWIND.
	JMP RDLIN		/AND GET NEXT COMMAND.
	.TITLE		SIZE COMMAND PROCESSOR.
/SERVICE SIZE REQUEST,STORE WORD COUNT FOR NEXT PUT REQUEST.
/ACCEPT WORD COUNT FROM TTY, DETERMINE IF OCTAL OR DECIMAL,
/AND THEN CONVERT TO BINARY AND STORE IN WORD COUNT REGISTER
/OF THE "PUT" ROUTINE.
SIZE	JMS ECHO	/ADD REQUEST TO DUMP FILE.
	JMS GETARG	/CONVERT NUMBER TO BINARY.
	LAC DCOUNT	/PICK UP BINARY NUMBER.
	CMA	/CHANGE TO ONES COMPLEMENT;POSITIVE.	
	SNA	/WAS IT TERMINATOR?
	JMP RDLIN	/IT WAS GET NEXT COMMAND.
	TAD ONE	/MAKE TWOS COMPLEMENT;POSITIVE.
	DAC GPCT	/STORE WORD COUNT WHERE PUT CAN USE IT.
	JMP RDLIN	/GET NEXT COMMAND.
	.TITLE		TAPEMARK COMMAND PROCESSOR.
/SERVICE TAPEMARK REQUEST; WRITE AN EOF MARKER.
WRTEOF	JMS ECHO		/PUT COMMAND LINE INTO DUMP FILE.
	JMS GETDRV	/WHERE SHOULD WE WRITE AN EOF MARKER?
	JMP TYQUES	/USER DOESN'T KNOW EITHER.
	JMS PUTDAT	/PUT UNIT NUMBER IN DAT SLOT 1.
	.MTAPE 1,4	/THEN WRITE ONE EOF ON THE TAPE.
	JMP RDLIN		/READ NEXT REQUEST.
	.TITLE		BACKSPACE COMMAND PROCESSOR.
/SERVICE BACKSPACE REQUEST.
BKSPCE	JMS ECHO		/ADD REQUEST LINE TO DUMP FILE.
	JMS GETDRV	/FIND OUT WHAT UNIT SHOULD BE BACKSPACED AND
	JMP TYQUES
	JMS PUTDAT	/  PUT UNIT NUMBER IN DAT SLOT 1.
	JMS GETARG	/NOW DECIDE HOW TO TERMINATE THE BACKSPACE OPERATION.
	LAW -2		/MAKE SURE TERMINATOR TYPED WAS NOT "EOT".
	TAD TERM		/TERM MUST BE 0, 1, OR 2.
	SMA!SZA		/SKIP IF LEGAL.
	JMP ILLTRM	/TERMINATOR WAS "EOT", COMPLAIN.
BKSLP1	.MTAPE 1,2	/ISSUE ONE BACKSPACE.
	.WAIT 1		/WAIT FOR COMPLETION AND STATUS REGISTER.
	DAC STATUS	/SAVE MAG TAPE STATUS (HANDLER RETURNS IT IN AC).
	JMS CHKTRM	/NOW GO FIND OUT IF WE'RE DONE YET.
	JMP BKSLP1	/MORE RECORDS TO BACKSPACE.
	JMP RDLIN		/ALL DONE, GET NEXT COMMAND.
	.TITLE		SPACE COMMAND PROCESSOR.
/SERVICE SPACE REQUEST; SPACE FORWARD SOME RECORDS.
SPCFWD	JMS ECHO		/PUT COMMAND LINE IN DUMP FILE.
	JMS GETDRV	/GET UNIT NUMBER TO BE REFERENCED.
	JMP TYQUES
	JMS PUTDAT	/AND PUT IT IN DAT SLOT 1.
	JMS GETARG	/THEN GO SET UP END OF OPERATION.
SPCLP1	.MTAPE 1,5	/SPACE FORWARD ONE RECORD.
	.WAIT 1		/WAIT FOR COMPLETION.
	DAC STATUS	/SAVE MAG TAPE STATUS (COMES BACK FROM .WAIT IN AC).
	JMS CHKTRM	/FIND OUT IF WE SHOULD SPACE FORWARD SOME MORE.
	JMP SPCLP1	/YES, SPACE OVER NEXT RECORD.
	JMP RDLIN		/NO, GET NEXT COMMAND.
	.TITLE		LOG COMMAND PROCESSOR.
/SERVICE LOG REQUEST; WRITE COMMENTS INTO OUTPUT FILE.
PRCOMT	LAC ECHOSW	/SAVE COMMAND-ECHO-WANTED INDICATOR.
	DAC PRCSW		/..
	DZM ECHOSW	/THEN SIMULATE "VERIFY ON" REQUEST.
PRCOM1	LAC TOCHRS	/PICK UP TOTAL TYPED CHARACTERS IN COMMENT LINE.
	TAD OUTADR	/FORM POINTER TO LINE TERMINATOR.
	DAC POINTR	/AND SAVE IT.
	LAC* POINTR	/NOW PICK UP THE TERMINATOR ITSELF.
	SAD ALTMOD	/DID USER TYPE AN ALT MODE?
	JMP PREND		/YES, GO FINISH UP LOG SEQUENCE.
	LAC TOTCHR		/NO. PICK UP TOTAL TYPED CHARACTERS AGAIN.
	SZA		/SKIP IF ONLY A CARRIAGE-RETURN WAS TYPED.
	JMS ECHO		/LINE IS NON-EMPTY, PUT IT IN DUMP FILE.
	LAW TYLINE	/THEN TAKE ANOTHER LINE FROM THE KEYBOARD.
	JMS TYPEIN	/..
	JMS UNPACK	/UNPACK THE TYPED LINE.
	TYLINE		/  FROM TYLINE...
	OUTLIN		/  ...TO OUTLIN.
	JMP PRCOM1	/AND GO CHECK THIS NEW LINE.
/COME HERE ON ALT MODE TYPED BY USER.  MEANS COMMENTS ALL FINISHED.
PREND	LAC TOTCHR	/WAS THE LINE EMPTY?
	SNA		/SKIP IF NOT.
	JMP PREND1	/IF LINE WAS EMPTY, GO FINISH UP.
	JMS TYPRTN	/LINE NON-EMPTY, TYPE A CARRIAGE-RETURN.
	LAW 17762	/THEN SUBSTITUTE A CARRIAGE-RETURN
	DAC* POINTR	/  FOR THE ALT MODE IN THE COMMENT LINE.
	JMS ECHO		/GO WRITE THE LINE.
PREND1	LAC PRCSW		/RESTORE THE ECHO-WANTED SWITCH
	DAC ECHOSW	/  TO ITS ORIGINAL STATE.
	JMP RDLIN		/AND GET NEXT COMMAND.
	.TITLE		OPEN COMMAND PROCESSOR.
/SERVICE OPEN REQUEST; OPEN DUMP OUTPUT FILE.
OPEN	NOP		/OR "JMP TYQUES" IF A FILE IS ALREADY OPEN.
	LAW	-DOS		/(RCHM-011) IS THE DUMP DEVICE FILE-STRUCTURED?
	TAD P03DEV	/CHECK STANDARD BUFFER SIZE TO FIND OUT.
	SPA		/SKIP IF DUMP DEVICE IS FILE-STRUCTURED.
	JMP RDLIN		/NON-FILE-STRUCTURED, IGNORE OPEN REQUEST.
	JMS GETCOM	/GET FILE NAME FROM COMMAND LINE.
	SNA		/SKIP IF A FILE NAME WAS REALLY TYPED.
	JMP TYQUES	/NO NAME GIVEN, COMPLAIN.
	LAW -2		/PACK A TWO-WORD FILE NAME.
	JMS PK6BT		/IN SIXBIT FORMAT.
	CWD		/FILE NAME IS IN CWD ARRAY.
NAMPTR	FILNAM		/IT WILL BE PACKED INTO FILNAM AND FILNAM+1.
	LAC DEFNAM	/SET UP DEFAULT EXTENSION ("LST") IN CASE
	DAC FILNAM+2	/  NO EXTENSION WAS GIVEN.
	JMS GETCOM	/NOW GO GET THE TYPED EXTENSION, IF PRESENT.
	SNA		/SKIP IF USER TYPED AN EXTENSION.
	JMP FSTFIL	/NO EXTENSION, USE "LST".
	LAW -1		/USER PROVIDED AN EXTENSION,
	JMS PK6BT		/  PACK IT INTO ONE WORD.
	CWD		/TAKE IT FROM CWD.
	FILNAM+2		/PUT IT IN FILNAM+2.
FSTFIL	.FSTAT 3,FILNAM	/IS A FILE OF THIS NAME ALREADY ON THE DUMP DEVICE?
	SNA		/SKIP IF FILE NAME FOUND IN DIRECTORY.
	JMP ENTFIL	/NAME GIVEN IS UNIQUE, GO ENTER THE FILE.
/COME HERE TO COMPLAIN WHEN THE FUMP-FILE NAME SPECIFIED BY THE
/USER IS THE SAME AS A NAME ALREADY PRESENT ON THE DUMP OUTPUT
/DEVICE (DAT SLOT 3).
	LAC OUT100	/SET UP ADDRESS OF TEMPORARY FILE-NAME ARRAY.
	DAC OUTPTR	/  FOR SUBROUTINE PUTCHR.
	LAC NAMPTR	/PICK UP ADDRESS OF FILE NAME TO PRINT.
	JMS SETNAM	/AND GO UNPACK IT.
	JMS MIXUP		/THEN COMBINE TWO STRINGS:
	XCT FNDMES	/  "FILE FOUND ON DUMP DEVICE"
OUT100	OUTLIN+100	/FILE NAME AND EXTENSION IN IMAGE FORM.
	LAW TYLINE	/NOW GO PRINT THE WHOLE MESSAGE.
	JMS TYPOUT	/..
	LAW DLQUES	/THEN ASK IF WE SHOULD DELETE THE OLD FILE.
	JMS TYPOUT	/..
	JMS YESNO		/WAIT FOR USER'S RESPONSE.
/THE FOLLOWING TWO INSTRUCTIONS ARE RETURNS FROM SUBROUTINE YESNO.  THE
/FIRST RETURN IS TAKEN IF THE USER TYPED ANYTHING BUT "CR", "Y", OR
/"YES" (I.E., THE USER'S ANSWER WAS NEGATIVE). THE SECOND RETURN
/IS TAKEN IF THE USER ANSWERED IN THE AFFIRMATIVE.
	JMP RDLIN		/ANSWER WAS NO, DON'T DELETE OLD FILE.
ENTFIL	.ENTER 3,FILNAM	/ANSWER WAS YES, ENTER DUMP OUTPUT FILE ON DAT SLOT 3.
	LAC BADARG	/PICK UP "JMP TYQUES".
	DAC OPEN		/AND DISALLOW REENTRY TO OPEN SEQUENCE.
	DAC FILOPN	/INDICATE A DUMP OUTPUT FILE IS NOW OPEN.
	JMP RDLIN		/ALL DONE, GET NEXT COMMAND.
FILOPN	0			/(RCHM-009) FILE OPEN FLAG 0=> NOT OPEN
				/(RCHM-009) NON 0 => OPEN.
	.TITLE		COPY COMMAND PROCESSOR.
/SERVICE COPY REQUEST.
COPY	JMS GETDRV	/GET INPUT DRIVE DESIGNATOR.
	JMP TYQUES	/IF NO INPUT DRIVE TYPED.
	DAC UNIT1		/SAVE AS INPUT UNIT.
	JMS GETDRV	/NOW GET OUTPUT DRIVE.
	JMP TYQUES
	DAC UNIT2		/AND SAVE THAT TOO.
	JMS ECHO		/ADD COMMAND LINE TO DUMP FILE.
	JMS GETARG	/NOW GO FIND OUT WHEN TO QUIT COPYING.
/ENTER LOOP TO COPY RECORDS FROM UNIT1 TO UNIT2.
COPLP1	LAC UNIT1
	DAC UNIT
	JMS PUTDAT
	JMS GETREC	/GET NEXT RECORD FROM INPUT TAPE.
	JMP COPEOF	/ERROR RETURNS: EOF ENCOUNTERED.
	JMP COPEOT	/  PHYSICAL EOT ENCOUNTERED.
	JMP DMOFLO	/  LONG INPUT RECORD.
	LAC UNIT2
	DAC UNIT
	JMS PUTDAT
	LAC COUNT		/TAKE TWO'S COMPLEMENT OF COUNT OF
	JMS TWOS		/  WORDS IN RECORD JUST READ.
	JMS PUTREC	/THEN GO PUT RECORD ON OUTPUT TAPE.
	JMP COPEOT	/ERROR RETURN: PHYSICAL EOT FOUND.
COPLP2	JMS CHKTRM	/SUCCESSFUL TRANSFER. ARE WE DONE YET?
	JMP COPLP1	/NO, GO COPY NEXT RECORD.
	JMP RDLIN		/ALL FINISHED, ACCEPT ANOTHER REQUEST.
COPEOF	LAC UNIT2		/EOF ON THE INPUT TAPE,
	DAC UNIT		/  WRITE ONE ON THE OUTPUT TAPE.
	JMS PUTDAT	/AFTER FIXING UP DAT SLOT 1.
	.MTAPE 1,4	/WRITE END-OF-FILE.
	JMP COPLP2	/AND GO SEE IF FINISHED YET.
COPEOT	JMS FXUNIT	/GO MAKE AN ASCII ERROR-UNIT NUMBER.
	JMS MIXUP		/COMBINE TWO ASCII MESSAGES:
	XCT EOTMES	/  "PHYSICAL EOT"
	XCT ENCOUN	/  "ENCOUNTERED, UNIT"
	PRUNIT		/AND THE UNIT NUMBER ON WHICH EOT WAS FOUND.
PRTMES	LAW TYLINE	/PICK UP ADDRESS OF NEW MESSAGE.
	JMS ERCOMT	/AND GO ADVERTISE THE DIFFICULTY.
	JMP RDLIN		/THEN ACCEPT ANOTHER REQUEST.
	.TITLE		EXAMINE COMMAND PROCESSOR.
/SERVICE EXAMINE REQUEST.
/ACCEPT RELATIVE BUFFER ADDRESS FROM TTY, DETERMINE IF OCTAL
/OR DECIMAL, CONVERT TO BINARY AND MAKE IT ABSOLUTE.
/DISPLAY THE CONTENTS OF THAT ADDRESS ON THE TTY IN FORMAT
/OF LAST MODE REQUEST. IF A CR IS FIRST CHAR STRUCK DISPLAY
/THE NEXT REGISTER; IF AN ALT MODE IS THE FIRST CHAR STRUCK
/OUTPUT A CR/LF AND GO GET NEXT COMMAND.
/IF A NUMBER IS FIRST CHAR STRUCK REPLACE THE CONTENTS OF THE 
/OPENED REGISTER WITH THE NUMBER TYPED AND TAKE APPROPREATE
/ACTION ON THE TERMINATOR.
EXAMNE	JMS ECHO	/ADD COMMAND LINE TO DUMP FILE
	JMS GETARG	/CONVERT NUMBER TO BINARY
	LAC BNUM	/PICK UP BINARY NUMBER
	TAD BUFADR	/ADD STARTING BUFFER ADDRESS
	DAC WRDPTR	/PUT RELATIVE ADRESS IN POINTER
XAM	LAC OUTADR	/SET POINTER ADDRESS
	DAC OUTPTR	/FOR EXPANSION ROUTINES
	LAC* WRDPTR	/PICK UP WORD WANTED
	XCT* DCCALL	/INTERPET ACCORDING TO
	LAC* WRDPTR	/CURRENT MODE SETTINGS
	XCT* EXPCAL
	LAC (40		/INSERT 2 SPACES
	JMS PUTCHR	/JUST TO LOOK PRETTY
	LAC (40		/ON TYPE OUT
	JMS PUTCHR
	LAW -176	/INSERT AN ALTMODE
	DAC* OUTPTR	/SO HE WILL STOP TYPING
	JMS PACK	/GO PACK INTO 5/7
	OUTLIN		/FROM OUTLIN
	TYLINE		/TO TYLINE
	LAW TYLINE	/PICK UP ADDRESS OF 5/7 BUFFER
	JMS TYPOUT	/AND TYPE IT OUT
	LAW TYLINE
	JMS TYPEIN	/WAIT ON RESPONSE
	JMS UNPACK	/NOW UNPACK INTO IMAGE ASCII
	TYLINE		/FROM TYLINE
	OUTLIN		/TO OUTLIN
	TAD OUTADR	/UNPACK RETURNS THE NUMBER OF WORDS IN OUTLIN
	DAC NUMPTR	/ADD OUTLIN TO THAT FOR ADDRESS OF LAST WORD IN BUFFER
	LAC OUTLIN	/PICK UP FIRST CHAR TYPED
	SPA		/WAS IT A TERMINATOR; SKIP IF NOT
	JMP SHUT		/TERMINATOR , GO PROCESS IT
	LAC (SKP		/SET UP GETNUM TO CONVERT
	DAC DECMK1	/OCTAL TO BINARY
	LAC OUTADR	/SET POINTER TO FIRST CHAR
	DAC NXTPTR	/TO BE CONVERTED
	JMS GETCOM	/SET UP CHAR IN PROPER BUFFER AND ORDER
	JMS GETNUM	//CONVERT OCTAL TO BINARY
	LAC BNUM		/PICK UP BINARY NUMBER
	DAC* WRDPTR	/STORE IT AWAY
	LAC (ADD BNUM	/RESET GETNUM FOR
	DAC DECMK1	/DECIMAL NUMBER
SHUT	LAC* NUMPTR	/PICK UP TERMINATOR
	XOR (777602	/WAS IT ALT MODE
	SNA
	JMP GOHOME	/YES CLOSE UP SHOP
	ISZ WRDPTR	/NO, ASSUME CR
	JMP XAM		/AND OPEN NEXT REGISTER
GOHOME	JMS TYPRTN	/OUTPUT A CR/LF, FOR BEAUTY
	JMP RDLIN		/GO GET NEXT COMMAND
	.TITLE		LIST AND DUMP COMMAND PROCESSORS.
/SERVICE LIST AND DUMP REQUESTS.
LIST	CLA		/DUMP ON TELEPRINTER
DUMP	DAC TYDEV		/  OR ON DUMP DEVICE; SET INDICATOR.
	JMS ECHO		/ADD DUMP COMMAND LINE TO DUMP OUTPUT FILE.
	JMS GETDRV	/WHAT UNIT IS TO BE REFERENCED?
	JMP TYQUES
	JMS PUTDAT	/PUT DRIVE NUMBER IN DAT SLOT 1.
	JMS GETARG	/FIND OUT WHEN TO STOP TAPE DUMP.
/ENTER MAJOR LOOP TO READ AND DUMP NEXT RECORD.
DMPLP1	JMS GETREC	/GO READ NEXT RECORD.
	JMP DMEOF		/RETURN HERE ON EOF ENCOUNTERED,
	JMP COPEOT	/  HERE ON PHYSICAL EOT,
	JMP DMOFLO	/  AND HERE ON RECORD TOO LONG.
	LAC COUNT		/PICK UP INPUT RECORD LENGTH.
	JMS TWOS		/AND CONVERT IT TO TWOS COMPLEMENT.
	DAC COUNT		/SAVE NEGATIVE COUNT OF WORDS IN RECORD.
	LAC BUFADR	/SET UP FIRST POINTER TO
	DAC BUFPTR	/  NEXT WORD TO DUMP.
	LAC ONE		/AND SET INITIAL WORD SEQUENCE
	DAC TOTWDS	/  NUMBER TO ONE.
/ENTER INNER LOOP TO SET UP AN OUTPUT LINE OF A WORD SEQUENCE NUMBER
/AND A BUNCH OF DATA WORDS.  THE NUMBER OF DATA WORDS IN EACH LINE,
/AND THE WAY THEY'RE TO BE REPRESENTED (OCTAL, SYMBOLIC, SIXBIT,
/OR ASCII), HAVE BEEN SET EITHER AT START TIME OR BY A PREVIOUS
/"MODE" REQUEST.
DMPLP2	LAC OUTADR	/RESET OUTPUT-CHARACTER POINTER TO
	DAC OUTPTR	/  BEGINNING OF DECNUM ARRAY.
LAW0	LAW 0
	DAC DCSW1
/SET UP WORD SEQUENCE NUMBER FOR PRINTING. FIRST, FIND OUT WHETHER
/CURRENT GLOBAL RADIX IS OCTAL OR DECIMAL.
	LAC RADIX		/PICK UP CURRENT-RADIX INDICATOR.
	SNA		/SKIP IF GLOBAL RADIX IS OCTAL.
	JMP CONV10	/RADIX IS DECIMAL, GO CONVERT SEQUENCE NUMBER.
	LAC TOTWDS	/PICK UP CURRENT SEQUENCE NUMBER.
	JMS EXPND8	/AND MAKE IT PRINTABLE OCTAL.
	JMP CONVX		/JUST TO SKIP DECIMAL REPRESENTATION OF SEQUENCE NUMBER.
/COME HERE TO CONVERT SEQUENCE NUMBER TO DECIMAL.
CONV10	LAC TOTWDS	/PICK UP BINARY SEQUENCE NUMBER.
	JMS BTOD		/GO CONVERT TO DECIMAL,
	OUTLIN+5		/  STORING DIGITS IN OUTLIN ARRAY.
CONVX	LAW -6		/NOW GO SUPPRESS LEADING ZEROES
	JMS SUPRES	/  IN CONVERTED NUMBER.
	40		/REPLACE WITH BLANKS.
	OUTLIN		/STRING TO EDIT IS IN OUTLIN ARRAY.
	LAC (6
	TAD OUTADR
	DAC OUTPTR
	LAW 40		/ALL SET, PUT OUT
	JMS PUTCHR	/  A COUPLE OF BLANKS.
	LAW 40		/..
	JMS PUTCHR	/..
/COME HERE WITH SEQUENCE NUMBER IN OUTPUT ARRAY (OUTLIN).  FIRST,
/SET UP TOTAL DATA WORDS TO DUMP IN THIS LINE BY REFERENCING
/APPROPRIATE ENTRY IN PARTBL.
DMPDTA	XCT* DWORDS	/LAW -NWORDS TO DUMP.
	DAC LINCT		/SAVE WORD COUNT FOR CURRENT MODE.
DMPLP3	LAC QUIT		/DID USER TYPE CONTROL-P?
	SNA		/SKIP IF NOT.
	JMP RDLIN		/IF SO, GET NEXT COMMAND.
	LAC* BUFPTR	/NO, GET NEXT DATA WORD FROM RECORD AREA.
	XCT* DCCALL	/JMS DECODE (ONLY IF MODE IS SYMBOLIC) OR NOP.
	LAC* BUFPTR	/PICK UP DATA WORD AGAIN.
	XCT* EXPCAL	/JMS EXPANSION.
LAW40	LAW 40		/GET A BLANK
	DAC DCSW1
	JMS PUTCHR	/  TO PUT BETWEEN EXPANDED WORDS.
	ISZ BUFPTR	/BUMP POINTER TO NEXT DATA WORD IN BUFFER.
	ISZ TOTWDS	/AND BUMP WORD SEQUENCE NUMBER.
	ISZ COUNT		/NOW SEE IF DATA WORDS IN RECORD ARE ALL DUMPED.
	SKP		/SKIP IF MORE WORDS IN RECORD.
	JMP ENDBUF	/NO MORE DATA WORDS, GO FINISH OFF SHORT OUTPUT LINE.
	ISZ LINCT		/NOW SEE IF OUTPUT LINE IS FULL.
	JMP DMPLP3	/ROOM FOR MORE WORDS, GET NEXT ONE.
	15\777777		/LINE IS COMPLETE, INSERT
	DAC* OUTPTR	/  A CARRIAGE RETURN.
	JMS PACK
	OUTLIN
	TYLINE
	JMS LINOUT
	JMP DMPLP2	/AND PROCESS ANOTHER LINE.
/COME HERE WHEN RECORD IS EXHAUSTED, USUALLY IN THE MIDDLE OF
/AN OUTPUT LINE.
ENDBUF	15\777777		/TERMINATE THE OUTPUT LINE (PREMATURELY)
	DAC* OUTPTR	/  WITH A CARRIAGE RETURN.
	JMS PACK
	OUTLIN
	TYLINE
	JMS LINOUT
INREC	JMS BLKLIN	/NOW WRITE TWO
	JMS BLKLIN	/  BLANK LINES.
	JMS CHKTRM	/AND GO SEE IF DUMP IS COMPLETE.
	JMP DMPLP1	/MORE RECORDS TO DUMP, READ NEXT ONE.
	JMP RDLIN		/ALL DONE, GET NEXT COMMAND.
/COME HERE ON VARIOUS CONDITIONS ENCOUNTERED ON THE INPUT TAPE.
DMEOF	LAC EOFWRD	/EOF ENCOUNTERED, GO
	JMS PRTEOF	/  PRINT "EOF".
	JMP INREC		/THEN DO INTER-RECORD PROCESSING.
/COME HERE ON LONG RECORD ENCOUNTERED ON INPUT TAPE.
DMOFLO	JMS FXUNIT	/FIRST, MAKE ASCII UNIT NUMBER.
	JMS MIXUP	/THEN COMBINE SOME TEXT STRINGS.
	XCT OFLMES	/"LONG RECORD"
	XCT ENCOUN	/"ENCOUNTERED, UNIT"
	CAL PRUNIT	/UNIT NUMBER.
	JMP PRTMES	/THEN GO ADVERTISE ERROR CONDITION.
	.TITLE		DLIST AND DDUMP COMMAND PROCESSORS.
/SECTION TO LIST CONTENTS OF FILE DIRECTORY.
DLIST	CLA		/DIRECTORY GOES TO TELEPRINTER, SET AC ZERO.
DDUMP	DAC TYDEV		/DIRECTORY GOES TO DUMP FILE, AC IS NON-ZERO.
	JMS GETDRV	/WHAT UNIT SHOULD DIRECTORY COME FROM?
	JMP TYQUES	/NO UNIT TYPED, COMPLAIN.
	JMS ECHO		/ADD COMMAND TO DUMP FILE.
	JMS PUTDAT	/PUT UNIT NUMBER IN DAT SLOT 1.
	.MTAPE 1,0	/REWIND THE INPUT UNIT.
	DZM EOFSW		/INDICATE NO EOF ENCOUNTERED YET.
PRDLP1	JMS GETREC	/READ A RECORD (SHOULD BE EOF OR DIRECTORY PROPER).
	JMP PRDEOF	/EOF ENCOUNTERED.
	JMP COPEOT	/PHYSICAL EOT ENCOUNTERED.
	JMP PRDER2	/LONG RECORD.
	JMP PRDLP2	/RECORD SEEMS OK, SEE IF IT REALLY IS A DIRECTORY.
PRDEOF	LAC EOFSW		/RECORD WAS AN EOF. WAS IT THE FIRST ONE?
	CMA		/COMPLEMENT AND UPDATE
	DAC EOFSW		/  EOFSW IN CASE IT WAS THE FIRST.
	SPA		/NOW SKIP IF IT WAS THE SECOND EOF ENCOUNTERED.
	JMP PRDLP1	/ONLY THE FIRST EOF SO FAR, GET NEXT RECORD.
/ERROR, TWO CONSECUTIVE EOF MARKERS.
PRDER2	LAW FMTERR	/"*DIRECTORY FORMAT ERROR."
	JMS ERCOMT	/GO TYPE IT OUT.
	JMP RDLIN		/AND FIND OUT WHAT TO DO NEXT.
/COME HERE WITH RECORD IN CORE. CHECK FOR FORMAT OK.
PRDLP2	LAC BUFADR	/SET UP POINTER TO FIRST
	DAC BUFPTR	/  WORD OF DIRECTORY RECORD.
	LAC (747377	/FIRST WORD SHOULD BE 747377.
	XOR* BUFPTR	/FIND OUT IF IT IS.
	SZA		/SKIP IF FIRST WORD IS OK.
	JMP PRDER2	/COMPLAIN IF IT IS NOT.
	LAW -401		/NOW DECIDE IF RECORD HAS PROPER LENGTH.
	TAD COUNT		/SHOUD BE 401(8) WORDS LONG.
	SZA		/SKIP IF LENGTH IS CORRECT.
	JMP PRDER2	/BAD RECORD LENGTH, COMMENT.
	ISZ BUFPTR	/BUMP POINTER TO
	ISZ BUFPTR	/  FILE-COUNTS ENTRY.
LAW777	LAW 17000		/TOTAL-FILE COUNT IS IN BITS 0-8.
	AND* BUFPTR	/TAKE TOTAL COUNT.
	CLL!RAR		/AND MOVE IT TO RIGHT HALF.
	RTR		/..
	RTR		/..
	RTR		/..
	RTR		/..
	TAD LAW777	/NOW FIX UP LEFT HALF OF ONE'S COMPLEMENT WORD.
	CMA		/MAKE IT POSITIVE.
	DAC PRTOTL	/AND SAVE TOTAL COUNT FOR PRINTING.
	LAC* BUFPTR	/NOW GET COUNT OF ACTIVE FILES (IN BITS 9-17).
	AND LAW777	/THROW AWAY TOTAL COUNT IN LEFT HALF.
	XOR* BUFPTR	/..
	XOR LAW777	/AND FILL LEFT HALF WITH ONES.
	DAC ACTVCT	/SAVE ONE'S COMPLEMENT COUNT FOR DONE TEST.
	CMA		/THEN MAKE IT POSITIVE
	DAC PRACTV	/  AND SAVE IT FOR PRINTING LATER.
	LAC BUFPTR	/NOW FORM A POINTER TO
	TAD (17		/  FIRST DEB IN
	DAC BUFPTR	/  FILE-NAME-ENTRY SECTION.
	JMS FXUNIT	/MAKE ASCII UNIT NUMBER.
	JMS MIXUP		/COMBINE TWO STRINGS.
	XCT DIRMES	/  "DIRECTORY LISTING, UNIT"
	CAL PRUNIT	/  UNIT NUMBER.
	JMS LINOUT	/THEN GO OUTPUT THE HEADING LINE.
PRDLP3	ISZ ACTVCT	/COUNT ACTIVE FILES (1'S COMPLEMENT).
	SKP		/MORE TO DO.
	JMP PRDLP4	/ALL FINISHED WITH FILE NAMES.
	LAC OUT100
	DAC OUTPTR
	LAC BUFPTR	/PICK UP ADDRESS OF NEXT DEB.
	JMS SETNAM	/GO OUTPUT THIS DEB.
	LAC (3		/BUMP DEB POINTER
	TAD BUFPTR	/BY 3.
	DAC BUFPTR	/..
	JMS MIXUP		/NOW SET UP THE FILE NAME.
	OUTLIN+100	/IT APPEARS IN RIGHT END OF OUTLIN ARRAY.
	JMS LINOUT	/GO PRINT THE FILE NAME.
	JMP PRDLP3	/THEN GO FOR MORE.
PRDLP4	JMS MIXUP		/PUT OUT A BLANK LINE.
	XCT BLNKS		/..
	JMS LINOUT	/..
	LAC PRACTV	/PICK UP ACTIVE COUNT.
	JMS PRDLNM
	JMS MIXUP
	DECNUM
	XCT AFILMS
	JMS LINOUT
	LAC PRTOTL
	JMS PRDLNM
	JMS MIXUP
	DECNUM
	XCT TFILMS
	JMS LINOUT
	JMS MIXUP
	XCT BLNKS
	JMS LINOUT
	JMP RDLIN
	.TITLE			DLIST AND DDUMP SEERVICE ROUTINES.
 
/ LINOUT: CALLED WHEN A RECORD IS TO BE PLACED IN THE DUMP FILE
/	  OR IN THE TELEPRINTER FILE.
/
/ CALLING SEQUENCE:
/
/	SET	TYDEV		/OUTPUT TO DUMP FILE.
/ OR
/	DZM	TYDEV		/OUTPUT TO TELEPRINTER.
/	JMS	MIXUP		/STORE ARGUMENTS IN OUTLINE.
/	ARG1
/	.
/	.
/	.
/	ARGN
/	JMS	LINOUT		/PLACE LINE IN DUMP FILE.
 
LINOUT	0
	LAC TYDEV
	SNA
	JMP LIN01
	JMS WRFILE
	JMP* LINOUT
LIN01	LAW TYLINE
	JMS TYPOUT
	JMP* LINOUT
PRDLNM	0
	JMS BTOD
PRDPT1	DECNUM+5
	CLA!CMA
	DAC DECNUM+6
	LAC DECPNT
	DAC PRDNPT
PRDLN1	LAC PRDNPT
	SAD PRDPT1
	JMP* PRDLNM
	LAC* PRDNPT
	SAD (60
	XOR (20
	DAC* PRDNPT
	ISZ PRDNPT
	JMP PRDLN1
PRTOTL	0
ACTVCT	0
PRACTV	0
PRDNPT	0
EOFSW	0
	.TITLE		EXIT COMMAND PROCESSOR
/SERVICE EXIT REQUEST.
EXIT	JMS CLSFIL	/CLOSE DUMP OUTPUT.
	.EXIT			/(RCHM-009) RETURN TO MONITOR.
	.TITLE		NEWDIR COMMAND PROCESSOR
/SECTION TO INITIALIZE FILE DIRECTORY.
NUDIRC	JMS GETDRV
	JMP TYQUES
	JMS PUTDAT
	.MTAPE 1,0
	.MTAPE 1,4
NUDIR1	.MTAPE 1,2
	.MTAPE 1,5
	LAC BUFADR
	DAC BUFPTR
	LAC (747377
	DAC* BUFPTR
	ISZ BUFPTR
	DZM* BUFPTR
	ISZ BUFPTR
MINUS1	LAW -1
	DAC* BUFPTR
	LAW -401
	JMS PUTREC
	JMP COPEOT
	.MTAPE 1,4
	.MTAPE 1,4
	.MTAPE 1,2
	JMP RDLIN
	.TITLE			NEWDIR SERVICE ROUTINES.
BLKLIN	0
	JMS MIXUP
	XCT BLNKS
	JMS LINOUT
	JMP* BLKLIN
BLNKS	002002
	0
	.ASCII <40><15>
PRTEOF	0
	DAC EOFLIN+6
	JMS BLKLIN
	JMS BLKLIN
	JMS MIXUP
	XCT EOFLIN
	JMS LINOUT
	JMP* PRTEOF
EOFLIN	010002
	0
	.ASCII '        EO'
	0
EOFWRD	.ASCII 'F'<15>
	.LOC .-1
EOTWRD	.ASCII 'T'<15>
	.LOC .-1
TOTWDS	0
DECPTR
LINCT
SEQCT
CONWDS	0
	.TITLE		CLOSE COMMAND PROCESSOR.
/SERVICE CLOSE REQUEST
CLOSE	LAC FILOPN
	SNA
	JMP TYQUES
	JMS CLSFIL
	JMP RDLIN
/SUBROUTINE CLSFIL
CLSFIL	0
	.CLOSE 3
	LAC NOPLIT
	DAC OPEN
	DZM FILOPN
	JMP* CLSFIL
	.TITLE		MODE COMMAND PROCESSOR.
/SET OUTPUT MODE
MODE	JMS ECHO
	JMS GETCOM
	DZM MODISP
	SNA
	JMP OCTMOD
	LAW -1
	JMS PK6BT
	CWD
	MODNAM
	LAC MODNAM
	SAD OCTSW
	JMP OCTMOD
	SAD SYMSW
	JMP SYMOD
	SAD ASCSW
	JMP ASCMOD
	SAD TRMSW
	JMP TRMOD
	JMP TYQUES
MODNAM	0
OCTSW	.SIXBT 'OCT'
SYMSW	.SIXBT 'SYM'
ASCSW	.SIXBT 'ASC'
TRMSW	.SIXBT 'TRI'
TRMOD	ISZ MODISP
ASCMOD	ISZ MODISP
SYMOD	ISZ MODISP
OCTMOD	LAC MODISP
	CLL!RAL		/MODISP * 2.
	TAD MODISP	/MODISP * 3.
	TAD PARTBL
	DAC DWORDS
	TAD ONE
	DAC DCCALL
	TAD ONE
	DAC EXPCAL
	JMP RDLIN
DWORDS	PARTBL+1
DCCALL	PARTBL+2
EXPCAL	PARTBL+3
MODISP	0
BUFPTR	0
	.TITLE		FORMAT COMMAND PROCESSOR.
 
/(RCHM-006)
/ INPUT TO THIS COMMAND IS OF THE FORM:
/
/	F(ORMAT) U,XYZ
/
/ WHERE U=UNIT NUMBER 0<=U<=7
/       X=CHANNEL DEFINITION (9 OR 7)
/       Y=PARITY (O(DD) OR E(VEN))
/       Z=DENSITY (2(00) OR 5(56) OR 8(00) BPI)
/       "D" THE CHARACTER D WHICH INDICATES USE THE DEFAULT FORMAT MAY
/	BE ENTERED.
/
/ WITH THE EXCEPTION OF THE UNIT NUMBER, WHICH MUST BE THE FIRST ELEMENT OF
/ THE COMMAND, THE RES MAY FOLLOW IN ANY ORDER.
 
FORMAT	JMS ECHO		/PUT FORMAT REQUEST INTO DUMP FILE.
	JMS GETDRV	/GET UNIT WHOSE FORMAT IS TO BE CHANGED.
	JMP TYQUES	/RETURN HERE IF UNIT UNRECOGNIZABLE.
	JMS PUTDAT	/PUT UNIT NUMBER IN DAT SLOT 1.
	LAC UNIT		/GET UNIT NUMBER.
	CLL		/USE AS INDEX
	RTL		/  TO DRIVE FORMAT TABLE.
	RTL		/..
	TAD (DRVTBL	/MAKE A POINTER TO APPROPRIATE ENTRY.
	DAC DRVPTR	/AND SAVE IT.
	JMS GETCOM	/NOW GET THE REST OF THE COMMAND.
	LAC CWDLIT	/MAKE A POINTER
	DAC CWDPTR	/  TO CWD ARRAY.
	DZM DNSW		/INDICATE NO DENSITY OR
	DZM PRSW		/  PARITY SPECIFIERS HAVE BEEN TYPED.
FMTNXT	LAC* CWDPTR	/GET CURRENT CHARACTER FROM COMMAND.
	ISZ CWDPTR	/BUMP POINTER FOR NEXT TIME.
	SPA!CLL		/IS THIS THE TERMINATOR? SKIP IF NOT.
	JMP FMTDON	/FINAL CHARACTER IN COMMAND, ALL DONE.
	SAD (104		/DATA CHAR. IS IT A "D"?
	JMP SETSTD	/YES, GO SET UP DEFAULT FORMAT.
	SAD (117		/DID HE TYPE "O"?
	JMP SETODP	/SET ODD PARITY IF SO.
	SAD (105		/DID HE TYPE "E"?
	JMP SETEVP	/SET EVEN PARITY IF SO.
/NOW CHECK FOR DENSITY SPECIFIERS.
	DZM DBITS		/INITIAL DENSITY = 200 BPI.
	SAD (62		/IS CHARACTER A "2"?
	JMP SET200	/YES, THEN 200 BPI IS WANTED.
	SAD (65		/OR A "5"?
	JMP SET556	/YES, 556 BPI.
	SAD (70		/OR AN "8"?
	JMP SET800	/YES, MEANS 800 BPI.
	SAD (67
	JMP SET7CH
	SAD (71		/OR DID HE TYPE "9"?
	JMP SET9CH	/IF SO, MEANS 9-CHANNEL (ALWAYS 800 BPI).
	JMP TYQUES	/CHARACTER UNRECOGNIZED, GO COMMENT.
 
/(RCHM-006)
/ 7 CHANNEL TAPE BEING USED, CLEAR THE 9 TRACK 800 BPI (3 IN DENSITY)
/ IF NECESSARY.
 
SET7CH	LAC	(3000		/(RCHM-006) FETCH MASK FOR DENSITY BITS.
	AND*	DRVPTR		/(RCHM-006) DENSITY BITS IN AC.
	XOR	(3000		/(RCHM-006) IS THIS DRIVE CURRENTLY SPECIFIED AS
				/(RCHM-006)  9 TRACK?
	SZA			/(RCHM-006) YES.
	JMP	FMTNXT		/(RCHM-006) NO, LEAVE 7 TRACK DENSITY ALONE.
	LAW	16777		/(RCHM-006) MASK TO TURN OFF 9 CHANNEL 800 BPI DENSITY
				/(RCHM-006)  BIT.
	AND*	DRVPTR		/(RCHM-006) TURN OFF EXTRA BIT.
	DAC*	DRVPTR		/(RCHM-006) UPDATE FORMAT TABLE.
	JMP	FMTNXT		/(RCHM-006) GO PROCESS NEXT FORMAT SPECIFICATION.
 
/ 9 CHANNEL TAPE BEING USED, MAKE SURE THAT DENSITY BITS ARE SET TO INDICATE
/ SPECIAL DENSITY (3)
 
SET9CH	DZM	DBITS		/(RCHM-006) CLEAR DENSITY CELL
	DZM	DNSW		/(RCHM-006) CLEAR DENSITY LOCKOUT FLAG.
	ISZ	DBITS		/(RCHM-006) COUNT ONCE FOR 9 CHANNEL DENSITY.
SET800	ISZ DBITS		/7-CHANNEL 800 BPI, DBITS = 2.
SET556	ISZ DBITS		/7-CHANNEL 556 BPI, DBITS = 1.
SET200	LAC	DNSW		/(RCHM-006) HAS THE DENSITY BEEN SET ALREADY?
	SZA			/(RCHM-006) NO, GO SET IT UP.
	JMP	FMTNXT		/(RCHM-006) YES, GO PROCESS NEXT FORMAT ITEM.
	LAC	DBITS		/(RCHM-006) FETCH DENSITY BITS FOR STORAGE IN TABLE.
	CLL!RAL		/NOW MOVE 2-BIT DENSITY FIELD
	RTL		/  TO BITS 7 AND 8.
	RTL		/  ..
	RTL		/  ..
	RTL		/  ..
	DAC DNSITY	/SAVE DENSITY WANTED.
	ISZ DNSW		/INDICATE SOME DENSITY SETTING WAS REQUESTED.
	JMP FMTNXT	/AND GO PROCESS THE NEXT CHARACTER TYPED.
/COME HERE TO SET UP PARITY.
SETEVP	CLA!SKP		/EVEN PARITY WANTED, VARIABLE "PARITY" = 0.
SETODP	LAC (004000	/ODD PARITY WANTED, TURN ON BIT 6.
	DAC PARITY	/SAVE EVEN OR ODD.
	ISZ PRSW		/INDICATE SOME PARITY SETTING WAS REQUESTED.
	JMP FMTNXT	/AND LOOK AT NEXT CHARACTER IN COMMAND.
/COME HERE ON ALL COMMAND CHARACTERS PROCESSED.
FMTDON	LAC PRSW		/SEE IF A PARITY SETTING WAS REQUESTED.
	SNA		/SKIP IF ONE WAS.
	JMP SETDEN		/IF NOT, GO CHECK FOR PRESENCE OF DENSITY REQUEST.
	LAW 13777		/THROW AWAY PARITY FROM
	AND* DRVPTR	/  TABLE ENTRY.
	TAD PARITY	/INSERT NEW PARITY.
	DAC* DRVPTR	/AND UPDATE TABLE ENTRY.
SETDEN	LAC DNSW		/WAS A DENSITY SETTING REQUESTED?
	SNA		/SKIP IF SO.
	JMP SETFMT	/IF NOT, GO ISSUE .MTAPE REQUEST.
	LAW 14777		/NEW DENSITY, THROW AWAY OLD.
	AND* DRVPTR	/..
	TAD DNSITY	/INSERT NEW DENSITY.
UPDFMT	DAC* DRVPTR	/AND UPDATE TABLE.
SETFMT	LAC* DRVPTR	/PICK UP ENTRY (IN CASE NO CHANGE WAS MADE).
	DAC MTCALL	/SET UP .MTAPE CAL.
	ISZ MTCALL	/MAKE IT REFERENCE DAT SLOT 1.
MTCALL	0
DRVPTR=MTCALL		/POINTER TO FORMAT TABLE ENTRY.
	7
	JMP RDLIN		/READ NEXT COMMAND.
DEFMT	0		/DEFAULT MTAPE, SET UP AT START TIME.
SETSTD	LAC DEFMT		/PICK UP DEFAULT FORMAT.
	JMP UPDFMT	/AND GO UPDATE TABLE.
DRVTBL	.BLOCK 10
	.TITLE		GET AND PUT COMMAND PROCESSORS.
/GET-PUT PROCESSORS.
GET	JMS GETDRV
	JMP TYQUES
	JMS PUTDAT
	JMS GETREC
	JMP GETEOF
	JMP GETEOT
	JMP GETOFL
	DAC GPCT
	LAC COUNT
	JMS BTOD
	DECNUM+5
	DAC .+5
	LAW -6
	DAC DECNUM+6
	
	JMS MIXUP
	XCT GSMESS
	0
	XCT GSMES1
	LAW TYLINE
	JMS TYPOUT
	JMP RDLIN
GETEOF	LAC .+2
	JMP .+4
	XCT EOFMES
	XCT EOTMES
GETEOT	LAC .-1
	DAC .+2
	JMS MIXUP
	0
	XCT ENCOUN
	LAW TYLINE
	JMS ERCOMT
	JMP RDLIN
GETOFL	LAW OFLMES
	JMS ERCOMT
	JMP RDLIN
GSMESS	ENDGSM-.*400+2
GPCT	0
	.ASCII 'RECSIZE: '<175>
ENDGSM=.
GSMES1	ENDGS1-.*400+2
GETCT	0
	.ASCII '(10)'<15>
ENDGS1=.
  
  
PUT	JMS GETDRV
	JMS PUTDAT
	LAW -1
	TAD GPCT
	CMA
	JMS PUTREC
	JMP PUTEOT
	JMP RDLIN
PUTEOT	LAW EOTMES
	JMS ERCOMT
	JMP RDLIN
	.TITLE		VERIFY COMMAND PROCESSOR.
/SET ECHO ON OR OFF.
VERIFY	JMS GETCOM
	SNA
	JMP VRFYON
	LAW -1
	JMS PK6BT
	CWD
	VFYWRD
	LAC VFYWRD
	SAD VON
	JMP VRFYON
	SAD VOFF
	SKP!CLA!CMA
	JMP TYQUES
	SKP
VRFYON	CLA
	DAC ECHOSW
	JMP RDLIN
VON	.SIXBT 'ON@'
VOFF	.SIXBT 'OFF'
ECHOSW	0		/INITIALLY ON.
VFYWRD	0
	.TITLE		NUMBER COMMAND PROCESSOR.
/RADIX CONTROL.
NUMBER	JMS GETCOM
	SNA
	JMP NUM10
	LAW -1
	JMS PK6BT
	CWD
	NUMWRD
	LAC NUMWRD
	SAD OCTSW
	JMP NUM10
	SAD TENWRD
	SKP!CLA
	JMP TYQUES
NUM10	DAC RADIX
	JMP RDLIN
RADIX	0		/GLOBAL RADIX INDICATOR: ZERO = DEC, NON-ZERO = OCT.
NUMWRD	0
TENWRD	.SIXBT 'DEC'
	.TITLE	GENERAL SERVICE ROUTINES.
/SUBROUTINE PUTDAT, INSERT UNIT # IN DAT TABLE ENTRY.
/CALLING SEQUENCE:
/	JMS PUTDAT
/UNIT = UNIT # TO INSERT.
PUTDAT	0
	LAC* LODAT	/PICK UP CURRENT CONTENTS OF DAT SLOT 1.
	AND (77777	/THROW AWAY OLD UNIT.
	TAD UNIT		/INSERT NEW UNIT.
	DAC* LODAT	/RESTORE DAT SLOT.
	JMP* PUTDAT	/AND EXIT TO CALLER.
LODAT	.DAT+1		/POINTER TO DAT SLOT 1.
  
  
/SUBROUTINE GETDRV, EXTRACT UNIT # FROM COMMAND STRING.
/CALLING SEQUENCE:
/	JMS GETDRV
/	RETURN IF NO UNIT TYPED.
/	RETURN WITH UNIT IN AC AND VARIABLE "UNIT".
GETDRV	0
SUPIN1=GETDRV		/CURRENT-CHARACTER POINTER FOR SUPRES.
	JMS GETCOM
	LAC CWD
	SPA
	JMP* GETDRV
	ISZ GETDRV
	AND (170
	SAD (60
	SKP
	JMP TYQUES
	LAC CWD+1
	SMA!CLL
	JMP TYQUES
	LAC CWD
	AND (7
	RTR
	RTR
	DAC UNIT
	JMP* GETDRV
UNIT	0
/COME HERE ON CONTROL P STRUCK BY USER.
RECOUP	DZM QUIT
	JMP BEGIN		/  AND RESTART.
SCOM16	116
SCOM17	117
QRETN	0
/SCAN, ATTEMPT TO MATCH TWO CHARACTER STRINGS.
/CALL:	JMS SCAN
/	ADDRESS OF STRING TO SEARCH FOR.
/	ADDRESS OF STRING UPON WHICH SEARCH IS TO BE PERFORMED.
/	RETURN IF STRING NOT FOUND.
/	RETURN IF END OF STRING1 FOUND.
/	RETURN IF END OF STRING2 FOUND.
SCAN	0
SUPIN2=SCAN		/LOOK-AHEAD POINTER FOR SUPRES.
	LAC* SCAN
	JMS GETBNK
	DAC STR1
	ISZ SCAN
	LAC* SCAN
	JMS GETBNK
	DAC STR2
	ISZ SCAN
SLOOP1	LAC* STR1
	SPA
	JMP SLP1
	LAC* STR2
	SPA
	JMP SLP2
	SAD* STR1
	SKP
	JMP* SCAN
	ISZ STR1
	ISZ STR2
	JMP SLOOP1
SLP2	ISZ SCAN
SLP1	ISZ SCAN
	JMP* SCAN
STR1	0
STR2	0
/SUBROUTINE GETARG, INTERPRET REQUESTED TERMINATING CONDITION IN COMMAND
/LINE.  THE CONDITION WANTED IS EITHER A NUMBER (MEANING: TERMINATE WHEN
/THIS MANY RECORDS HAVE BEEN TRANSFERRED) OR A CHARACTER STRING DENOTING
/SOME TAPE STATUS (MEANING: TERMINATE WHEN THIS CONDITION IS OBSERVED
/ON THE UNIT BEING MANIPULATED).  THE TYPED STRING IS MAPPED INTO AN
/INTEGER (RANGE 0-3) WHICH IS THEN USED AS AN INDEX TO A DISPATCH TABLE.
/THAT TABLE IS ACCESSED BY SUBROUTINE CHKTRM TO FIND OUT WHERE TO GO TO
/DECIDE WHETHER THE OPERATION REQUESTED IS COMPLETE YET (CHKTRM IS CALLED
/AFTER EACH RECORD IS PROCESSED).  THE CONTENTS OF THE DISPATCH TABLE
/INDEX (VARIABLE "TERM") ARE SET BY GETARG AS FOLLOWS:
/	TERMINATING
/	 CONDITION   TERM
/	SOME NUMBER    0
/	   "BOT"       1
/	   "EOF"       2
/	   "EOT"       3
  
GETARG	0		/ENTRY TO FIGURE OUT WHEN OPERATION WILL BE COMPLETE.
SUPSIZ=GETARG		/STRING LENGTH FOR SUPRES.
	DZM TERM		/ASSUME NUMERIC ARGUMENT TO START OFF.
	JMS GETCOM	/NOW GO EXTRACT TYPED ARGUMENT FROM COMMAND LINE.
	LAC CWD		/PICK UP FIRST CHAR OF ARGUMENT TO SEE IF ONE WAS TYPED.
	SPA		/SKIP IF AN EXPLICIT TERMINATING CONDITION WAS GIVEN.
	JMP NUM001	/NO ARGUMENT, TAKE UNDERSTOOD TERMINATOR OF NUMERIC "1".
	AND (160		/ARGUMENT PRESENT, EXTRACT HIGH-ORDER BITS.
	SAD (60		/IS IT A NUMBER?
	JMP NUMARG	/YES, GO DECIDE WHAT TO DO WITH IT.
/ARGUMENT IS NON-NUMBER, MAKE SURE IT'S EXACTLY THREE CHARACTERS LONG.
	LAC CWD+3		/PICK UP WHAT SHOULD BE ARRAY TERMINATOR.
	SMA		/ALL SET IF IT REALLY IS A TERMINATOR.
	JMP TYQUES	/NOT THREE CHARACTERS, COMPLAIN.
	LAW -1		/PACK THE THREE CHARACTERS INTO ONE WORD FOR LATER COMPARE.
	JMS PK6BT		/PK6BT WILL DO IT.
	CWD		/CWD...CWD+2 HOLDS UNPACKED ARGUMENT.
	ENDSW		/THREE SIXBIT CHARS WILL BE PACKED INTO ENDSW.
	LAC ENDSW		/PICK UP THE PACKED PARAMETER.
	SAD EOTEND	/IS IT "EOT"?
	JMP DMPEOT	/YES, SET TERM = 3.
	SAD EOFEND	/NO, IS IT "EOF"?
	JMP DMPEOF	/YES, THEN TERM = 2.
	SAD BOTEND	/LAST CHANCE.  IS IT "BOT"?
	JMP DMPBOT	/YES, SET TERM = 1.
	JMP ILLTRM	/UNRECOGNIZED ARGUMENT.  GO COMPLAIN.
/TABLE OF LEGAL NON-NUMERIC TERMINATOR ARGUMENTS.
EOTEND	.SIXBT 'EOT'
EOFEND	.SIXBT 'EOF'
BOTEND	.SIXBT 'BOT'
/COME HERE ON RECOGNIZED PARAMETER TO SET UP DISPATCH-TABLE INDEX.
DMPEOT	ISZ TERM		/FINISH ON LOGICAL EOT, TERM = 3.
DMPEOF	ISZ TERM		/FINISH ON EOF MARKER, TERM = 2.
DMPBOT	ISZ TERM		/FINISH ON LOAD-POINT MARKER, TERM = 1.
UPDARG	LAC TERM		/NUMERIC ARGUMENT, TERM = 0
	TAD (EDISPT	/FORM POINTER TO APPROPRIATE ENTRY IN DISPATCH TABLE.
	DAC ENDPTR	/AND SAVE IT WHERE CHKTRM CAN GET AT IT.
	DZM EOTSW		/TURN OFF EOT-ENCOUNTERED FOR CHKTRM.
	JMP* GETARG	/THEN EXIT TO CALLER.
/DISPATCHERS TO ENTRIES IN SUBROUTINE CHKTRM TO SEE IF OPERATION COMPLETE.
EDISPT	JMP ENDOFL	/TERMINATE ON RECORD-COUNT OVERFLOW.
	JMP ENDBOT	/TERMINATE ON PHYSICAL BOT ENCOUNTERED.
	JMP ENDEOF	/TERMINATE ON EOF MARKER ENCOUNTERED.
	JMP ENDEOT	/TERMINATE ON LOGICAL EOT ENCOUNTERED.
ENDPTR	TYQUES
ENDSW	0
DCOUNT	0
/COME HERE WHEN FIRST CHARACTER OF PARAMETER IS A NUMBERIC TO DECIDE
/WHETHER THE ARGUMENT IS OCTAL OR DECIMAL REPRESENTATION.  IDEA HERE
/IS TO SEE IF FINAL TYPED CHARACTER IS "D" (FOR DECIMAL) OR "K" (FOR
/OCTAL), DENOTING LOCAL RADIX SPECIFICATION.  IF SO, INTERPRET THE NUMBER
/APPROPRIATELY.  IF NOT, USE CURRENT GLOBAL RADIX.
TERM	0		/INDEX TO DISPATCH TABLE ("EDISPT").
NUMARG	LAW -1		/FORM A POINTER TO
	TAD CWDPTR	/  THE LAST CHARACTER IN THE NUMBER STRING.
	DAC NMAPTR	/SAVE IT.
	LAC* NMAPTR	/PICK UP THE FINAL CHARACTER.
	AND (160		/TAKE HIGH-ORDER BITS TO FIND OUT
	SAD (60		/  IF CHARACTER IS A NUMBER.
	JMP OLDRDX	/IT IS, SO USE CURRENT GLOBAL RADIX.
	LAC* NMAPTR	/NON-NUMBER, PICK UP CHARACTER AGAIN.
	XOR (104	/IS IT "D".
	SNA!CMA		/0="D".
	JMP INTDEC	/SET UP FOR DECIMAL RADIX.
	SAD (-20	/-20="K" FOR OCTAL RADIX
	SKP!CLA!CMA	/IF OCTAL NEED ALL 7S.
	JMP TYQUES	/UNRECONIZED CHAR.
	JMP INTOCT	/SET UP FOR OCTAL RADIX.
OLDRDX	LAC RADIX	/PICK UP GLOBAL RADIX.
	SZA
	JMP NUM001	/GLOBAL IS OCTAL.
	JMP DECRAD	/GLOBAL IS DECIMAL.
INTDEC	DAC* NMAPTR	/STORE A NEW TERMINATOR.
	JMP DECRAD	/SET UP FOR DECIMAL RADIX.
INTOCT	DAC* NMAPTR	/STORE NEW TERMINATOR.
NUM001	LAC (SKP
	SKP
DECRAD	LAC (ADD BNUM
	DAC DECMK1	/SET SWITCH FOR DECIMAL OR OCTAL RADIX.
	JMS GETNUM	/GO CONVERT TO BINARY.
	DAC DCOUNT	/STORE BINARY NUMBER.
	XCT DECRAD	/RESTORE TO DECIMAL CONVERTER.
	XCT DECRAD+1
	JMP UPDARG	/RETURN TO CALLING ROUTINE
ORADIX	.SIXBT '@AK'	/ASCII "K".
DRADIX	.SIXBT '@AD'	/ASCII"D".
WRDPTR=DRVPTR
SCOM4=DRADIX		/POINTER TO .SCOM+4.
  
/SUBROUTINE SUPRES, REPLACE LEADING ZEROES IN AN UNPACKED
/(ONE CHAR PER WORD) ASCII ARRAY.  TERMINATES ON CHARACTER-COUNT
/OVERFLOW (SEE CALLING SEQUENCE) OR ON THE APPEARANCE OF A TERMINATOR
/WORD (BIT 0 = 1) IN THE INPUT ARRAY, WHICHEVER OCCURS FIRST.
/CALLING SEQUENCE:
/	LAW -LENGTH	/TWO'S COMPLEMENT COUNT OF CHARS IN STRING.
/	JMS SUPRES	/CALL SUPRES.
/	40		/ACTUAL CHARACTER (NOT ADDRESS) TO USE.
/	ARRAY		/13- OR 15-BIT ARRAY BEGINNING.
SUPRES	0		/ENGTRY TO THROW AWAY LEADING ZEROES.
	DAC SUPSIZ	/SAVE LENGTH OF INPUT ARRAY.
	LAC* SUPRES	/PICK UP REPLACEMENT CHARACTER.
	DAC SUPCHR	/SAVE IT.
	ISZ SUPRES	/BUMP TO ARRAY ORIGIN.
	LAC* SUPRES	/PICK UP START OF ARRAY.
	ISZ SUPRES	/BUMP TO RETURN.
	JMS GETBNK	/GET EPC BITS.
	DAC SUPIN1	/SAVE AS CURRENT-CHARACTER POINTER.
	DAC SUPIN2	/AND FORM A
SUPR01	ISZ SUPIN2	/  LOOK-AHEAD POINTER.
	LAC* SUPIN2	/PICK UP CURRENT CHARACTER PLUS ONE.
	ISZ SUPSIZ	/AND SKIP IF THE CURRENT CHAR IS THE LAST ONE.
	SPA		/SKIP IF NEXT CHARACTER IS A DATA CHARACTER.
	JMP* SUPRES	/CURRENT CHAR IS FINAL CHAR, EXIT.
	LAC* SUPIN1	/NOW GET THIS CHARACTER.
	SAD (60		/IS IT A ZERO?
	SKP		/YES, REPLACE IT.
	JMP* SUPRES	/NO, ALL DONE.
	LAC SUPCHR	/PICK UP PADDING CHARACTER.
	DAC* SUPIN1	/AND PUT IT PLACE OF ZERO.
	ISZ SUPIN1	/BUMP CURRENT-CHARACTER POINTER.
	JMP SUPR01	/AND GO FOR MORE.
  
/SUBROUTINE CHKTRM, SEE IF REQUESTED OPERATION IS COMPLETE.
/DISPATCH THROUGH THE TABLE ENTRY (SET UP BY GETARG) TO THE
/APPROPRIATE SECTION.  CHECK THERE FOR THE PROPER TERMINATING CONDITION.
/CHKTRM IS CALLED EACH TIME A RECORD IS PROCESSED.
/CALL:	JMS CHKTRM
/	RETURN IF MORE TO DO.
/	RETURN IF ALL FINISHED.
CHKTRM	0		/ENTRY TO CHECK FOR COMPLETION.
SUPCHR=CHKTRM		/REPLACEMENT CHARACTER FOR SUPRES.
	JMP* ENDPTR	/DISPATCH TO THE PROCESSOR WANTED.
/ENTRY TO CHECK RECORD-COUNT OVERFLOW.
ENDOFL	ISZ DCOUNT	/COUNT RECORDS TREATED SO FAR.
	JMP* CHKTRM	/MORE TO DO, EXIT TO CALL+1.
	ISZ CHKTRM	/COUNT OVERFLOW, BUMP RETURN.
	JMP* CHKTRM	/AND EXIT TO CALL;2.
/ENTRY TO CHECK IN RESPONSE TO "BOT".
ENDBOT	LAC STATUS	/PICK UP MAG TAPE STATUS FROM LAST TRANSFER.
	AND (100000	/EXTRACT BOT STATUS BIT.
	SZA		/SKIP IF BOT NOT ENCOUNTERED.
	ISZ CHKTRM	/LOAD POINT, BUMP RETURN.
	JMP* CHKTRM	/END EXIT.
/ENTRY TO CHECK IN RESPONSE TO "EOF".
ENDEOF	LAC STATUS	/PICK UP LATEST MAG TAPE STATUS.
	AND (010000	/EXTRACT EOF-ENCOUNTERED.
	SZA		/SKIP IF NOT EOF.
	ISZ CHKTRM	/EOF, BUMP RETURN.
	JMP ENDBOT	/CHECK FOR BOT
/ENTRY TO CHECK IN RESPONSE TO "EOT".
ENDEOT	LAC STATUS	/GET STATUS.
	AND (010000	/TAKE EOF-ENCOUNTERED.
	SZA		/NO EOF, SKIP.
	JMP ENDET1	/LAST RECORD WAS EOF, CHECK THE ONE BEFORE THAT.
	DZM EOTSW		/TURN OFF EOF ENCOUNTERED.
	JMP* CHKTRM	/AND RETURN TO CALL+1.
ENDET1	SAD EOTSW		/HAVE WE SEEN TWO EOF7S IN A ROW? SKIP IF NOT.
	ISZ CHKTRM	/TWO CONSECUTIVE EOF'S, BUMP TO DONE RETURN.
	DAC EOTSW		/INDICATE AT LEAST ONE EOF SEEN.
	JMP* CHKTRM	/AND RETURN.
/SUBROUTINE CHKLST, DETERMINE IF DUMP DEVICE (DAT SLOT 3) IS TTY.
/CALLING SEQUENCE:
/	JMS CHKLST
/	JMP SAMDEV	/DUMP DEVICE IS TTY.
/	XX		/DUMP DEVICE IS NOT TTY.
CHKLST	0
	LAC* DATM02
	AND (77777
	DAC M02DEV
	LAC* DATP03
	AND (77777
	SAD M02DEV
	SKP
	ISZ CHKLST
	JMP* CHKLST
DATP03	.DAT+3		/LISTING DEVICE
DATM02	.DAT-2
/SUBROUTINE ECHO, WRITE COMMAND LINE INTO OUTPUT FILE.
ECHO	0
	JMS CHKLST	/IF LISTING DEVICE IS TELEPRINTER,
	JMP* ECHO		/  RETURN IMMEDIATELY.
	LAC ECHOSW
	SNA
WRECHO	JMS WRFILE
	JMP* ECHO
/PARAMETER TABLES FOR DUMP FORMATS.
/WORD 1:	WORDS PER LINE (2'S COMPLEMENT)
/WORD 2:	JMS DECODE OR NOP
/WORD 3:	JMS EXPANSION SUBROUTINE
PARTBL	PARTBL+1
/OCTAL DUMP PARAMATERS...
	LAW -11		/9 WORDS PER LINE
NOPLIT	NOP		/DON'T DECODE OP CODE.
	JMS EXPND8	/6-DIGIT EXPANSION.
/SYMBOLIC DUMP PARAMETERS...
	LAW -6		/6 WORDS PER LINE.
	JMS DECODE	/INTERPRET OP CODE.
	JMS EXPND5	/EXPAND 5 OCTAL DIGITS.
/5-7 ASCII DUMP PARAMETERS...
NEG12	LAW -12		/12 WORD-PAIRS***
	NOP
	JMS EXPN57	/5-7 ASCII EXPANSION
/TRIMMED ASCII DUMP PARAMETERS...
	LAW -20		/16(10) WORDS PER LINE.
	NOP
	JMS EXPND6
  
/SUBROUTINE DECODE, OUTPUT SYMBOLIC REPRESENTATION OF OP CODE AND
/INDIRECTION BIT.  ENTER WITH WORD TO BE DECODED IN AC.
DECODE	0
	AND LAW0		/EXTRACT BITS 0-4.
	SAD LAW0		/IS IT A LAW INSTRUCTION?
	JMP LAWCOD	/YES, TREAT AS SPECIAL CASE.
	CLL!RAL		/NO, MOVE OP CODE BITS
	RTL		/  TO LOW-ORDER
	RTL		/  PART OF WORD.
	DAC DCWRD1	/AND SAVE AS INDEX TO TABLE OF SYMBOLICS.
	CLA!RAR		/NOW RETRIEVE THE INDIRECT BIT FROM LINK.
	DAC INDIR		/AND SAVE THAT FOR LATER.
	LAC (LAC CODTBL
	TAD DCWRD1	/INDEX TO APPROPRIATE ENTRY.
	DAC DCWRD1	/SAVE ACCESS TO ENTRY WANTED.
DCSW1	LAW 40		/PUT OUT A BLANK.
	JMS PUTCHR	/..
DCWRD1	0		/LAC CODTBL+OPCODE.
WRCODE	JMS EXPND6
	LAC INDIR
	SZA!CLA
	LAW 12
	XOR LAW40
	JMS PUTCHR
	JMP* DECODE
LAWCOD	DZM INDIR
	LAC LAWENT
	JMP WRCODE
CODTBL	.SIXBT 'CALDACJMSDZMLACXORADDTADXCTISZANDSADJMPEAEIOTOPR'
LAWENT	.SIXBT 'LAW'
  
/SUBROUTINE PUTCHR, PUT CHARACTER IN AC 11-17 IN OUTLIN.
PUTCHR	0
	AND C177
	SNA
	JMP* PUTCHR
	DAC* OUTPTR
	ISZ OUTPTR
	JMP* PUTCHR
  
/SUBROUTINE EXPND6, PRINT 3 6-BIT CHARACTERS.
EXPND6	0
EXP8WD=EXPND6
	DAC EXP6WD	/SAVE WORD TO BE DUMPED.
	LAW -3		/COUNT 3 CHARACTERS EACH WORD.
	DAC EXP6CT	/SAVE CHARACTER COUNT.
EXP6LP	LAC EXP6WD	/PICK UP WORD WITH THIS CHAR IN BITS 0-6.
	RTL		/MOVE CHARACTER TO LOW-ORDER PART OF WORD.
	RTL		/..
	RTL		/..
	DAC EXP6WD	/SAVE WORD FOR NEXT TIME.
	RAL		/RETRIEVE LAST BIT FROM LINK.
	AND C77		/THROW AWAY JUNK.
	SNA		/***** FUDGE FOR FILE-NAME
EXP6SW	NOP		/*****   PRINTING.
	DAC PUTCHR
	AND LAW40
	SNA!CLA
	LAW 100
	TAD PUTCHR
	JMS PUTCHR
	ISZ EXP6CT
	JMP EXP6LP
	JMP* EXPND6
  
  
/SUBROUTINE EXPND8, EXPAND  A WORD (IN AC) TO 6 OCTAL DIGITS.
/CALLING SEQUENCE:
/	LAC WORD		/PICK UP WORD TO BE EXPANDED.
/	JMS EXPND8
EXPND8	0
EXP6WD=EXPND8
	DAC EXP8WD
	LAW -6
EXP5NT	DAC EXP8CT
EXP8LP	LAC EXP8WD
	RTL
	RAL
	DAC EXP8WD
	RAL
	AND (7
	TAD (60
	JMS PUTCHR
	ISZ EXP8CT
	JMP EXP8LP
	JMP* EXPND8
  
  
/EXPND5, EXPAND ADDRESS PORTION OF WORD IN AC.
EXPND5	0
EXP8CT=EXPND5
EXP6CT=EXPND5
	CLL!RAL
	RTL
	DAC EXP8WD
	LAC EXPND5
	DAC EXPND8
	LAW -5
	JMP EXP5NT
  
 
/SUBROUTINE EXPN57, EXPAND A 5-7 ASCII WORD PAIR.
/CALLING SEQUENCE:
/	LAC* BUFPTR	/PICK UP FIRST WORD OF PAIR.
/	JMS EXPN57
/ON ENTRY, BUFPTR MUST POINT TO FIRST WORD.
EXPN57	0
	DAC PWRD2		/SAVE FIRST WORD.
	ISZ BUFPTR	/BUMP POINTER TO SECOND WORD OF PAIR.
	LAC* BUFPTR	/AND GET THAT.
	DAC PWRD3		/SAVE SECOND WORD, TOO.
	ISZ TOTWDS	/BUMP COUNT OF WORDS CONSIDERED IN THIS RECORD.
	LAW -5		/SET UP COUNTER
	DAC PK5CHR	/  OF FIVE CHARACTERS TO EXTRACT.
EXP57L	JMS PRAL7		/GET NEXT CHARACTR FROM WORD PAIR.
	LAC PWRD1		/CHARACTER APPEARS IN PWRD1, RIGHT-ADJUSTED.
	AND C177			/THROW AWAY JUNK.
	DAC PWRD1		/SAVE SEVEN-BIT CHARACTER.
/CHECK FOR PRINTABILITY OF CHARACTER.
	LAW -40		/IS CHAR .G. 40?
	TAD PWRD1		/..
	SPA		/SKIP IF SO.
	JMP NOPRNT	/IF NOT, PRINT A BLANK.
	LAW -137		/IS IT .LE. 137?
	TAD PWRD1		/.
	SPA!SNA		/SKIP IF NOT.
	JMP PRCHR		/UPPER CASE CHARACTER, GO PRINT.
	SAD ONE		/IS CHARACTER .E. 140?
	JMP NOPRNT	/YES, PRINT BLANK IN ITS PLACE.
	LAW -40		/LOWER CASE CHARACTER, CHANGE
	TAD PWRD1		/  TO UPPER CASE.
	DAC PWRD1		/..
	LAW -132		/IS CHAR NOW .LE. Z?
	TAD PWRD1		/..
	SMA!SZA		/SKIP IF PRINTABLE.
	JMP NOPRNT	/133-137, DON'T TRY TO PRINT.
PRCHR	LAC PWRD1
EXPUT	JMS PUTCHR
	ISZ PK5CHR
	JMP EXP57L
FENCE	LAW -1
	ISZ COUNT
	SKP
	DAC COUNT
	JMP* EXPN57
NOPRNT	LAW 40
	JMP EXPUT
EXP57P	0
  
/PUTREC. CALL:
/	LAW -NWORDS
/	JMS PUTREC
/	JMP EOT		/RETURN IF PHYSICAL EOT FOUND ON OUTPUT TAPE.
PUTREC	0
	DAC WRTCT
	LAC BUFADR
	DAC WRTADR
WRTRAN	.TRAN	1,1,0,0,0
WRTADR=WRTRAN+3
WRTCT=WRTRAN+4
	.WAIT 1
	DAC WRSTAT
	AND (020600
	SZA
	JMP PTRERR
	LAC WRSTAT
	AND EOTMSK
	SZA
	JMP* PUTREC
	ISZ PUTREC
	JMP* PUTREC
PTRERR	.MTAPE 1,2
	JMP WRTRAN
WRSTAT	0
  
/SUBROUTINE ERCOMT, PUT AN ASCII MESSAGE IN THE DUMP OUTPUT FILE
/(IF ONE IS OPEN) AND ON THE TELEPRINTER (IF TTY IS NOT THE DUMP
/DEVICE).
/CALLING SEQUENCE:
/	LAW MESSAG	/13-BIT ADDRESS OF .ASCII MESSAGE.
/	JMS ERCOMT	/GO OUTPUT MESSAGE.
ERCOMT	0		/ENTRY TO WRITE ASCII MESSAGE.
	JMS GETBNK	/MAKE A 15-BIT ADDRESS.
	DAC ERMS01	/SAVE IT IN CAL SEQUENCE.
	JMS TYPOUT	/THEN GO TYPE THE COMMENT.
	LAC FILOPN	/IS A DUMP FILE OPEN?
	SZA		/SKIP IF NOT.
	JMS CHKLST	/IF SO, IS THE TTY THE DUMP DEVICE?
	JMP* ERCOMT	/YES, EXIT NOW.
ERDUMP	.WRITE 3,2,0,0	/NO, PUT COMMENT IN DUMP FILE.
ERMS01=ERDUMP+2		/MESSAGE ADDRESS IN CAL SEQUENCE.
	JMP* ERCOMT	/RETURN TO CALLER.
  
  
/SUBROUTINE UNPACK, IOPS ASCII TO ONE CHAR PER WORD. ON RETURN,
/IOPS LINE IS UNPACKED IN "TO" ARRAY AS 7-BIT CHARACTERS, ONE PER
/WORD, RIGHT-ADJUSTED WITH LEADING ZEROES. INITIAL LINE FEED (IF
/ANY) AND TERMINATING CARRIAGE RETURN (OR ALT MODE) ARE DELETED. IN PLACE
/OF THE TERMINATING CHARACTER IS INSERTED ITS 1'S COMPLEMENT (I.E.,
/000015 BECOMES 777762). THE ACCUMULATOR AND REGISTER "TOTCHR" HOLD POSITIVE
/TOTAL NUMBER OF DATA CHARACTERS UNPACKED, EXCLUSIVE OF THE TERMINATOR.
/NOTA BENE: UNPACK USES AUTOINDEX REGISTERS 3 AND 6 (LOCATIONS 12 AND 15)
/AS INPUT AND OUTPUT POINTERS.
/CALL:	JMS UNPACK	/GO TO UNPACK.
/	FROM		/15-BIT ADDRESS OF WORD 0 OF LINE BUFFER HEADER.
/	TO		/15-BIT ADDRESS OF FIRST CHAR OF OUTPUT LINE.
UNPACK	0		/ENTRY TO UNPACK.
PKFROM=UNPACK		/PACK, PK6BT: POINTER TO NEXT CHARACTER IN INPUT ARRAY.
	LAC* UNPACK	/GET ADDRESS OF INPUT LINE.
	DAC* C12		/SAVE AS INPUT POINTER (IN LOC 12).
	ISZ* C12		/ADJUST TO POINT TO FIRST DATA PAIR.
	ISZ UNPACK	/BUMP TO SECOND ARGUMENT.
	LAC* UNPACK	/ARG 2 IS ADDRESS OF OUTPUT LINE.
	TAD FENCE		/DECREMENT BY ONE.
	DAC* C15		/SAVE AS POINTER TO OUTPUT ARRAY (IN LOC 15).
	ISZ UNPACK	/BUMP TO RETURN.
	DZM TOTCHR	/ZERO TOTAL CHARACTERS IN LINE.
	DZM FSTSW		/INDICATE NO DATA ENCOUNTERED YET.
/ENTER MAJOR LOOP TO GET NEW WORD PAIR FROM INPUT LINE AND
/RESET CHARACTER COUNTER (PK5CHR) TO 5.
UNPLP1	LAC* 12		/GET NEXT WORD FROM LINE BUFFER.
	DAC PWRD2		/SAVE AS FIRST WORD OF PAIR.
	LAC* 12		/PICK UP NEXT WORD.
	DAC PWRD3		/SECOND WORD OF NEW CURRENT PAIR.
	LAW -5		/SET UP TO EXTRACT 5 CHARACTERS FROM THIS PAIR.
	DAC PK5CHR	/..
/ENTER INNER LOOP TO GET NEXT CHARACTER FROM CURRENT WORD PAIR,
/STORE IT IN OUTPUT ARRAY, AND CHECK FOR COMPLETION.
UNPLP2	JMS PRAL7		/GET NEXT CHAR FROM CURRENT PAIR.
	AND C177		/TAKE ONLY RIGHTMOST SEVEN BITS.
	SNA		/ACCEPT ONLY IF NON-NULL.
	JMP UNPB5C	/NULL CHARACTER, IGNORE.
	SAD C12		/LINE FEED?
	JMP UNPLNF	/YES, GO IGNORE ONLY IF FIRST CHARACTER IN LINE.
	SAD C175		/ALT MODE TYPE TERMINATOR?
	JMP UNPCR		/YES, TREAT JUST LIKE CARRIAGE RETURN.
	SAD C15		/CARRIAGE RETURN?
	JMP UNPCR		/YES, LINE IS COMPLETE.
UNPDAC	DAC* 15		/REAL ASCII CHAR, DEPOSIT IN OUTPUT ARRAY.
	DAC FSTSW		/INDICATE SOME DATA ENCOUNTERED.
	ISZ TOTCHR	/BUMP TOTAL DATA CHARACTERS SEEN.
	LAC TOTCHR	/GET TOTAL CHARACTERS SEEN.
	ADD ONE		/WILL WE OVERFLOW NEXT TIME?
	SAD MAXLEN	/SKIP IF NOT.
	JMP UNPOFL	/OTHERWISE, STOP NOW.
UNPB5C	ISZ PK5CHR	/COUNT 5 CHARACTERS FROM CURRENT PAIR.
	JMP UNPLP2	/NOT FINISHED WITH THIS PAIR, GET NEXT CHARACTER.
	JMP UNPLP1	/CURRENT PAIR EXHAUSTED, GET NEXT ONE.
UNPOFL	LAC C15		/TOO MANY CHARS, GET CARRIAGE RETURN.
UNPCR	CMA		/LINE FINISHED, GET TERMINATOR.
	DAC* 15		/INSERT AS LAST WORD OF OUTPUT LINE.
	LAC TOTCHR	/PICK UP TOTAL DATA CHARACTERS PROCESSED.
	JMP* UNPACK	/RETURN TO CALLER.
UNPLNF	LAC FSTSW		/LINE FEED FOUND. HAVE WE SEEN ANY BEFORE?
	SNA		/SKIP IF NOT.
	JMP UNPB5C	/YES, SO TREAT AS NORMAL DATA CHARACTER.
	LAC C12		/NO, SET TO ACCEPT LATER ONES.
	JMP UNPDAC	/THEN GO IGNORE THIS ONE.
C175	175
C15	15
FSTSW	0
MAXLEN	120
  
/SUBROUTINE PACK, RIGHT-ADJUSTED 7-BIT CHARACTER ARRAY TO HEADERED
/IOPS ASCII. TERMINATES ON NEGATIVE WORD IN INPUT ARRAY.
/NOTE: USES AUTOINDEX REGISTER 3 (LOCATION 12) AS POINTER TO
/OUTPUT LINE.
/CALL:	JMS PACK		/GO TO PACK.
/	FROM		/15-BIT ADDRESS OF FIRST CHAR OF INPUT ARRAY.
/	TO		/15-BIT ADDRESS OF FIRST WORD OF OUTPUT LINE.
PACK	0		/ENTRY TO PACK.
	LAC* PACK		/PICK UP START OF INPUT ARRAY.
	DAC PKFROM	/GIVE TO INPUT POINTER.
	ISZ PACK		/BUMP ENTRY TO ARG 2.
	LAC* PACK		/GET ADDRESS OF LINE BUFFER TO FILL.
	DAC PLBH		/SAVE AS ADDRESS OF WORD 0 OF HEADER.
	DAC* C12		/AND ALSO IN OUTPUT POINTER.
	ISZ* C12		/SET LOC 12 TO POINT TO CHECKSUM.
	DZM* PLBH		/SET INITIAL VALUE OF HEADER WORD 0.
	DZM LSTSW		/INDICATE TERMINATOR NOT SEEN YET.
	ISZ PACK		/BUMP TO RETURN.
/ENTER MAJOR LOOP TO UPDATE WORD-PAIR COUNT IN LINE BUFFER HEADER
/(LOCATION POINTED TO BY "PLBH") FOR WORD-PAIR JUST CONSTRUCTED
/(OR FOR HEADER PAIR ON FIRST TIME THROUGH) AND TO RESET CHARACTER
/COUNTER (PK5CHR) TO -5.
PLOOP1	LAC (1000		/TURN ON BIT 8.
	ADD* PLBH		/ADD IN WORD PAIR COUNT DEVELOPED SO FAR.
	DAC* PLBH		/NEW WORD 0.
	LAW -5		/SET UP TO PUT 5 CHARACTERS IN THE NEW PAIR.
	DAC PK5CHR	/..
/ENTER INNER LOOP TO GET NEXT CHARACTER FROM INPUT LINE, CHECK FOR
/COMPLETION, AND INSERT IN CURRENT PAIR.
PLOOP2	LAC* PKFROM	/GET NEXT CHARACTER FROM INPUT ARRAY.
	SPA		/TERMINATOR? (NEGATIVE IF SO.)
	JMP PCLOSE	/YES, GO TRY TO CLOSE THE OUTPUT LINE.
	ISZ PKFROM	/NO, BUMP POINTER TO NEXT CHARACTER.
PLOOP6	RTR		/SHIFT THIS CHARACTER TO BITS 0-6.
	RTR		/..
	RTR		/..
	RTR		/..
	DAC PWRD3		/ADD TO RIGHT-HAND END OF EMERGING PAIR.
PLOOP7	JMS PRAL7		/GO ROTATE THIS CHARACTER INTO THE PAIR.
	ISZ PK5CHR	/COUNT 5 CHARACTERS PER PAIR.
	JMP PLOOP2	/NOT FINISHED WITH THIS PAIR, GET NEXT CHARACTER.
	LAC PWRD2		/PAIR IS COMPLETE, BUT STILL OFF BY ONE BIT.
	CLL!RAL		/CLEAR PAIR BIT 35.
	DAC PWRD2		/PAIR BIT 17 IS NOW IN LINK.
	LAC PWRD1		/GET FIRST WORD OF PAIR...
	RAL		/...AND MOVE PAIR BIT 17 IN.
	DAC* 12		/PAIR IN PROPER FORMAT; DEPOSIT WORD 1 IN LINE BUFF.
	LAC PWRD2		/PICK UP WORD 2.
	DAC* 12		/STORE IT IN LINE BUFFER ALSO.
	JMP PLOOP1	/GO REINITIALIZE FOR NEXT PAIR.
/COME HERE ON TERMINATOR FOUND IN INPUT ARRAY.
PCLOSE	SAD LSTSW		/HAVE WE BEEN HERE BEFORE? (LSTSW = 0 IF NOT.)
	JMP PKNULL	/YES, GO FILL CURRENT PAIR WITH NULLS.
	DAC LSTSW		/NO, SET LSTSW TO ENABLE BYPASS NEXT TIME THROUGH.
	CMA		/INVERT TERMINATOR.
	SNA		/IS IT NOW A NULL CHARACTER?
	LAC C15		/IF SO, GET CARRIAGE RETURN.
	JMP PLOOP6	/GO PUT CARRIAGE RETURN OR ALT MODE AWAY.
/COME HERE TO PAD WORD-PAIR WITH NULLS AFTER TERMINATING CHARACTER
/HAS BEEN INSERTED.
PKNULL	LAW -5		/FIRST, SEE IF PAIR IS ALREADY FULL.
	XOR PK5CHR	/..
	SZA!CLA!CLL!CML	/PAIR IS FULL IF PK5CHR .E. -5.
	JMP PLOOP6	/PAIR IS NON-FULL, INSERT NULL JUST GENERATED.
	RTL		/FULL, SET IOPS ASCII INDICATOR (AC = 2).
	ADD* PLBH		/INSERT MODE IN HEADER.
	DAC* PLBH		/RESTORE HEADER IN LINE BUFFER AREA.
	JMP* PACK		/ALL DONE, EXIT.
  
/SUBROUTINE PRAL7, ROTATE IOPS ASCII WORD PAIR SEVEN BITS TO THE LEFT.
/DURING UNPACKING, THE WORD PAIR BEING TREATED MUST BE STORED IN REGISTERS
/PWRD2 AND PWRD3; THE NET EFFECT OF PRAL7 IS TO PLACE "THIS" CHARACTER FROM
/THE PAIR IN THE RIGHTMOST SEVEN BITS OF REGISTER PWRD1 AND TO LEAVE THE
/"NEXT" CHARACTER IN THE LEFTMOST SEVEN BITS OF REGISTER PWRD2. DURING PACKING,
/THE CHARACTER TO BE ADDED MUST BE STORED IN THE LEFTMOST SEVEN BITS OF 
/REGISTER PWRD3; THE CHARACTER IS ADDED TO THE RIGHT-HAND END OF THE WORD
/PAIR BEING DEVELOPED. AFTER FIVE CALLS TO PRAL7, THE 5-CHARACTER PAIR,
/SHIFTED ONE BIT TO THE RIGHT, APPEARS IN REGISTERS PWRD1 AND PWRD2.
PRAL7	0
	LAW -7		/SET UP SEVEN-BIT COUNTER.
	DAC PK7BTS	/..
PRALL7	LAC PWRD3		/ROTATE A SINGLE BIT
	RAL		/FROM PWRD3 TO PWRD1.
	DAC PWRD3
	LAC PWRD2
	RAL
	DAC PWRD2
	LAC PWRD1
	RAL
	DAC PWRD1
	ISZ PK7BTS	/COUNT SEVEN BITS TO GET.
	JMP PRALL7	/NOT FINISHED, ROTATE OUT ONE MORE BIT.
	JMP* PRAL7	/ALL DONE, RETURN TO CALLER.
PLBH
LSTSW
PK5CHR
PWRD1
PWRD2
PWRD3
PK7BTS
PK6WDC
PK6TO
PK6CT1
C77	77
PKCHR
  
/SUBROUTINE PK6BT, RIGHT-ADJUSTED 7-BIT CHARACTERS TO 3-6 TRIMMED
/ASCII, ZERO-FILLED. TERMINATES ON END CODE (BIT 0 = 1) IN INPUT ARRAY
/OR WORD COUNT OVERFLOW (COUNT -- 2'S COMPLEMENT -- IN AC AT CALL).
/CALL:	LAW -MAXWDS	/2'S COMPLEMENT WORDS TO FILL.
/	JMS PK6BT		/CALL PK6BT.
/	FROM		/START OF INPUT ARRAY.
/	TO		/START OF OUTPUT ARRAY.
PK6BT	0		/ENTRY TO PK6BT.
TOTCHR=PK6BT		/UNPACK: TOTAL CHARS IN OUTPUT LINE.
	DAC PK6WDC	/SAVE COUNT OF  TOTAL WORDS TO FILL.
	LAC* PK6BT	/GET START OF INPUT ARRAY.
	JMS GETBNK	/MAKE IT A 15-BIT ADDRESS.
	DAC PKFROM	/GIVE TO INPUT POINTER.
	ISZ PK6BT		/BUMP TO OUTPUT ADDRESS.
	LAC* PK6BT	/GET START OF OUTPUT ARRAY.
	JMS GETBNK	/MAKE IT 15 BITS LONG ALSO.
	DAC PK6TO		/GIVE TO OUTPUT POINTER.
	ISZ PK6BT		/BUMP TO RETURN.
PK6LP1	LAW -3		/THREE CHARS PER WORD.
	DAC PK6CT1	/SET UP 3-CHARACTER COUNTER.
	DZM* PK6TO	/ZERO NEW OUTPUT WORD.
PK6LP2	LAC* PKFROM	/GET NEXT CHARACTER FROM INPUT ARRAY.
	SPA!CLL		/IS THIS THE ARRAY TERMINATOR? (NEGATIVE IF SO.)?
	JMP PK6CLS	/YES, GO GENERATE A NULL CHARACTER.
	AND C77		/NO, EXTRACT RIGHTMOST SIX BITS.
	DAC PK6CHR	/THEN SAVE AS CURRENT CHARACTER.
	ISZ PKFROM	/BUMP INPUT POINTER FOR NEXT TIME.
PK6LP3	LAC* PK6TO	/GET 3-6 WORD GENERATED SO FAR.
	RTL		/SHIFT IT SIX BITS LEFT TO MAKE ROOM FOR CURRENT CHAR.
	RTL		/..
	RTL		/..
	ADD PK6CHR	/THEN INSERT CURRENT CHARACTER.
	DAC* PK6TO	/SAVE NEW 3-6 WORD.
	ISZ PK6CT1	/COUNT 3 CHARACTERS PACKED IN THIS WORD.
	JMP PK6LP2	/MORE TO DO, GET NEXT CHARACTER.
	ISZ PK6TO		/ALL DONE WITH THIS WORD, BUMP OUTPUT POINTER.
	ISZ PK6WDC	/COUNT MAXIMUM WORDS IN OUTPUT ARRAY.
	JMP PK6LP1	/MORE ROOM IN OUTPUT ARRAY, SET UP NEW WORD.
PK6RET	JMP* PK6BT	/OUTPUT ARRAY IS FULL, RETURN TO CALLER.
/COME HERE ON TERMINATOR FOUND IN INPUT ARRAY. FILL REMAINDER OF OUTPUT
/ARRAY WITH NULL (00) CHARACTERS.
PK6CLS	DZM PK6CHR	/MAKE CURRENT CHAR A NULL.
	JMP PK6LP3	/AND PUT IT AWAY. NEXT INPUT CHAR WILL BE SAME TERMINATOR
PK6CHR	0
TOCHRS	0
/SUBROUTINE MIXUP, CONSTRUCT A LINE OF TEXT CONSISTING OF INTERSPERSED
/SEGMENTS OF PACKED 5/7 ASCII LINES AND UNPACKED (ONE CHAR PER WORD)
/ASCII ARRAYS.  THE LINE SO CONSTRUCTED IS UNPACKED, ON EXIT, IN ARRAY
/"OUTLIN" AND IS TERMINATED BY A CARRIAGE RETURN IN ONE'S COMPLEMENT
/FORM (777762).  THE SAME LINE IS PROPERLY PACKED IN TYLINE AND
/IS READY TO WRITE IN IOPS ASCII MODE.
/CALLING SEQUENCE:
/	JMS MIXUP		/GO TO MIXUP.
/FOLLOWED BY AS MANY (13- OR 15-BIT) ADDRESSES AS DESIRED IN THE
/FOLLOWING FORMAT:
/IF BIT 0 IS A 0 --
/	THE ADDRESS POINTS TO THE FIRST CHARACTER OF AN UNPACKED ARRAY.
/IF BIT 0 IS A 1 --
/	THE ADDRESS POINTS TO HEADER WORD 0 OF AN ASCII LINE.
/THE ARGUMENT LIST IS TERMINATED BY A WORD IN WHICH ANY BIT EXCEPT 0
/IS SET TO 1.  FOR EXAMPLE:
/	JMS MIXUP
/	XCT DECNUM	/UNPACKED ARRAY.
/	CAL TOTFLS	/ASCII LINE.
/	JMS PRINT		/TERMINATOR; CONTROL RETURNS HERE.
MIXUP	0		/ENTRY TO COMBINE TEXT STRINGS.
	LAC OUTADR	/PICK UP ADDRESS OF OUTPUT AREA
	DAC OUTPTR	/AND SAVE IN OUTPUT POINTER.
MIXLP1	LAC* MIXUP	/PICK UP NEXT ARGUMENT.
	AND (300000	/TAKE BITS 1 AND 2.
	SZA		/IF THESE ARE BOTH ZERO, THIS IS AN ARGUMENT.
	JMP MIXDON	/IF EITHER ONE IS ON, THIS IS THE ARGUMENT-STRING TERMINATOR.
	LAC* MIXUP
	JMS GETBNK	/EXPAND ADDRESS TO 15 BITS.
	DAC MIXIN		/SAVE AS INPUT POINTER.
	LAC* MIXUP	/GET PARAMETER AGAIN.
	ISZ MIXUP		/  AND BUMP TO NEXT ARGUMENT IN LIST.
	SPA		/SKIP IF TEXT IS UNPACKED.
	JMP MIXASC	/ASCII LINE, GO PROCESS IT.
MIXLP2	LAC* MIXIN	/PICK UP A CHARACTER.
	SMA		/SKIP IF A TERMINATOR.
	JMP MIXDTA	/DATA CHARACTER, GO PUT AWAY.
	DAC* OUTPTR	/PUT TERMINATOR IN OUTPUT STRING.
	JMP MIXLP1	/ALL DONE WITH THIS STRING, TREAT NEXT ONE.
MIXDTA	JMS PUTCHR	/GO PUT CHARACTER AWAY.
	ISZ MIXIN		/BUMP INPUT POINTER TO NEXT CHARACTER.
	JMP MIXLP2	/AND PROCESS NEXT ONE.
MIXASC	JMS UNPACK	/UNPACK THE ASCII LINE.
MIXIN	0		/FROM THE ADDRESS IN ARGUMENT LIST.
OUTPTR	0		/TO THE CURRENT POSITION IN OUTLIN.
	LAC* C15		/NOW TAKE FINAL OUTPUT POINTER FROM UNPACK.
	DAC OUTPTR	/THAT WILL BE OUR NEW OUTPUT POINTER.
	JMP MIXLP1	/ALL DONE, GET NEXT ARGUMENT.
MIXDON	777762		/TEXT ALL FINISHED, GET CARRIAGE RETURN.
	DAC* OUTPTR	/AND PUT IT AT TEXT END.
	JMS PACK		/NOW PACK UP THE WHOLE THING.
	OUTLIN		/ARRAY IS IN OUTLIN.
	TYLINE		/IT WILL BE PACKED INTO TYLINE.
	JMP* MIXUP	/THEN RETURN TO CALLER.
  
/SUBROUTINE WRFILE, DOUBLE-BUFFERED WRITE-OUTPUT-FILE.
/CALL:	JMS WRFILE
/	RETURN
WRFILE	0
	LAC QUIT
	SNA
	JMP RECOUP
	LAW	-DOS		/(RCHM-011) CHECK FOR FILE STRUCTURED DUMP DEVICE.
	TAD P03DEV
	SPA
	JMP .+4
	LAC FILOPN
	SNA
	JMP NOFILE
	LAC WRPAK2	/EXCHANGE BUFFER ADDRESSES. GET BUFFER USED LAST.
	DAC WRTEMP	/SAVE THAT ADDRESS TEMPORARILY.
	LAC WRALTB	/GET START OF ALTERNATE BUFFER.
	DAC WRPAK2	/USE THAT BUFFER FOR PACKING THIS LINE.
	DAC WRCAL2	/WRITE FROM THAT BUFFER ALSO.
	LAC WRTEMP	/NOW GET THE FIRST BUFFER AGAIN.
	DAC WRALTB	/AND SAVE AS ALT BUFFER FOR NEXT TIME.
	JMS PACK		/GO PACK THE OUTPUT LINE.
	OUTLIN		/LINE TO BE PACKED IS ALWAYS IN OUTLIN.
WRPAK2	WRBUF2		/MODIFIED EACH TIME TO POINT TO "CURRENT" BUFFER.
OUTCAL	.WRITE 3,2,0,0
WRCAL2=OUTCAL+2
	JMP* WRFILE	/NO WAIT REQUIRED AFTER WRITING.
WRALTB	WRBUF1		/MODIFIED EACH TIME TO POINT TO "OTHER" BUFFER.
WRTEMP	0
  
  
/SUBROUTINE GETREC, READ NEXT RECORD FROM INPUT TAPE.
/CALLING SEQUENCE:
/	JMS GETREC
/	JMP EOF		/RETURN IF EOF ENCOUNTERED.
/	JMP EOT		/RETURN IF PHYSICAL EOT FOUND.
/	JMP OFLO		/RETURN IF RECORD TOO LONG.
/	XX		/RETURN IF ALL OK WITH RECORD LENGTH IN AC (POSITIVE)
GETREC	0
	LAW -100		/SET UP MAX ERROR-REREAD COUNTER.
	DAC GTERCT	/..
TREAD	.TRAN 1,0,0,0,0
BUFADR=TREAD+3
MAXWDS=TREAD+4
	.WAIT 1
	DAC STATUS
/CHECK FOR EOF.
	AND EOFMSK
	SZA
	JMP EOFRTN
/CHECK FOR EOT.
	LAC STATUS
	AND EOTMSK
	SZA!CLA!CMA
	JMP EOTRTN
/CHECK FOR EOF AGAIN (ONLY ONE FRAME TRANSFERRED).
	TAD* (32
/	MTF 011 WRITES REAL 9 TRACK EOF INSTEAD OF 7 TRACK.
/	HARDWARE ONLY DETECTS IT AS A SHORT RECORD <EDIT 003>
	SAD MAXWDS
	JMP SHTREC  /<EDIT 003> CALL IT EOF.  SET EOF BIT IN STATUS WORD
/CHECK FOR READ ERRORS.
	LAC STATUS
	AND (020600
	SZA
	JMP ERRTN
	LAC STATUS
	AND RLIMSK
	SZA!CLA!CMA
	JMP CHKRLI
GETSIZ	TAD MAXWDS
	CMA
	TAD* (32
	DAC COUNT
	ISZ GETREC
OFLRTN	ISZ GETREC
EOTRTN	ISZ GETREC
EOFRTN	JMP* GETREC
/CHECK FOR RECORD TOO LONG.
/<EDIT 003> ONE WORD RECORD IS EOF. SET STATUS BIT
SHTREC	LAC STATUS
	TAD EOFMSK	/EOF BIT
	DAC STATUS
	JMP* GETREC	/..AND TAKE EOF EXIT <EDIT 003>
/
CHKRLI	LAC* (32
	SNA!CLA!CMA
	JMP OFLRTN
	JMP GETSIZ
ERRTN	.MTAPE 1,2
	ISZ GTERCT
	JMP TREAD
	LAW PRMERR
	JMS TYPOUT
	JMP RDLIN
GTERCT	0
COUNT	0
STATUS	0
EOFMSK	010000
EOTMSK	004000
RLIMSK	001000
  
  
/SUBROUTINE YESNO, TYPE A RIGHT ANGLE-BRACKET AND WAIT FOR USER'S
/AFFIRMATIVE OR NEGATIVE RESPONSE.  IF THE USER TYPES "YES", "Y", OR
/JUST A CARRIAGE RETURN, THEN RESPONSE IS TAKEN TO BE AFFIRMATIVE AND
/CONTROL GOES TO CALL+2.  IF THE USER TYPES ANYTHING ELSE, THEN
/RESPONSE IS INTERPRETED AS NEGATIVE AND RETURN IS MADE TO
/CALL+1.
/CALLING SEQUENCE:
/CALL:	JMS YESNO
/CALL+1:	JMP NO	/ANSWER WAS NOT YES.
/CALL+2:	JMP YES	/ANSWER WAS YES, Y, OR CR.
  
YESNO	0		/ENTRY TO INTERPRET YES OR NO RESPONSE.
	LAW 76		/PICK UP A RIGHT ANGLE-BRACKET
	JMS TYONCH	/  AND GO TYPE IT OUT.
	LAW TYLINE	/PICK UP ADDRESS OF INPUT-LINE AREA.
	JMS TYPEIN	/AND ACCEPT (AND WAIT FOR) A LINE OF INPUT.
	LAC TYLINE+2
	AND (774000
	SAD (064000
	SKP
	SAD (544000
YESRTN	ISZ YESNO		/IF SO, THAT MEANS YES.
	JMP* YESNO	/TAKE APPROPRIATE RETURN.
  
  
/BTOD. CALL:
/	LAC NUM		/NUMBER TO BE CONVERTED.
/	JMS BTOD		/CALL BTOD
/	.DSA LOW-ORDER RESULT
/	DAC HIORD		/RETURN WITH ADDRESS OF LEFT DIGIT.
BTOD	0		/ENTRY TO BTOD.
	DAC B2DNUM	/SAVE NUMBER TO CONVERT.
	LAW -6		/6-DIGIT ARRAY.
	DAC B2DQUO	/COUNT OF WORDS TO ZERO.
	TAD* BTOD		/PICK UP LOW-ORDER ADDRESS.
	DAC B2DPTR
	ISZ BTOD		/BUMP TO RETURN.
B2DLP1	ISZ B2DPTR	/BUMP POINTER TO NEXT LOCATION IN ARRAY.
	LAC (60		/ASCII ZERO
	DAC* B2DPTR	/TO ARRAY.
	ISZ B2DQUO	/COUNT SIX WORDS.
	JMP B2DLP1	/MORE TO DO.
/COME HERE WITH OUTPUT ARRAY FILLED WITH ASCII ZEROES.
B2DLP2	DZM B2DQUO	/ZERO QUOTIENT REGISTER.
B2DLP3	LAC B2DNUM	/PICK UP DIVIDEND.
	TAD NEG12		/REDUCE BY 10.
	DAC B2DNUM	/SAVE PARTIAL RESULT.
	SPA		/SKIP IF MORE TO DO.
	JMP B2DPRO	/ALL FINISHED.
	ISZ B2DQUO	/BUMP QUOTIENT.
	JMP B2DLP3	/TRY AGAIN.
/COME HERE ON DIVIDE COMPLETE.
B2DPRO	TAD (72		/FORM REMAINDER IN ASCII.
	DAC* B2DPTR	/INSERT IN ARRAY.
	LAC B2DQUO	/GET QUOTIENT.
	DAC B2DNUM	/NEW DIVIDEND.
	SZA!CLA!CMA	/SKIP IF RESULT = 0.
	JMP B2DMOR	/MORE TO DO.
	LAC B2DPTR	/ALL DONE, GET LEFT DIGIT.
	JMP* BTOD		/AND RETURN TO CALLER.
B2DMOR	TAD B2DPTR	/REDUCE OUTPUT POINTER.
	DAC B2DPTR	/BY ONE.
	JMP B2DLP2	/THEN GO FOR MORE.
B2DQUO	0
B2DNUM	0
DECNUM	.BLOCK 7
	.TITLE		BINARY TO IMAGE ASCII CONVERSION.
 
/(RCHM-007)
/ CALL TO THIS CONVERSION ROUTINE IS OF THE FORM:
/
/	LAC	NUMBER		/NUMBER TO BE CONVERTED
/	JMS	BTOA
/	BUFFER			/6 WORD OUTPUT BUFFER
/
 
BTOA	XX			/(RCHM-007) BINARY TO DECIMAL CONVERSION ENTRY.
	DAC	BTOATP		/(RCHM-007) SAVE NUMBER FOR CONVERSION LATER.
	LAC*	BTOA		/(RCHM-007) FETCH OUTPUT BUFFER ADDRESS.
	IDX	BTOA		/(RCHM-007) BUMP RETURN ADDRESS.
	DAC	BTOABP		/(RCHM-007) SAVE OUTPUT BUFFER POINTER.
	LAW	-6		/(RCHM-007) SET UP TO CONVERT 6 OCTAL DIGITS.
	DAC	BTOALC		/(RCHM-007) LOOP COUNTER.
	LAC	BTOATP		/(RCHM-007) FETCH NUMBER TO BE CONVERTED.
	RAL			/(RCHM-007) ROTATE ONCE TO ELIMINATE THE LINK.
 
/ THIS IS THE CONVERSION LOOP.
 
BT0010	RAL; RTL		/(RCHM-007) ROTATE IN NEXT OCTAL DIGIT FOR CONVERSION.
	DAC	BTOATP		/(RCHM-007) SAVE FOR NEXT DIGIT.
	AND	(7		/(RCHM-007) EXTRACT OCTAL DIGIT.
	XOR	(60		/(RCHM-007) OR IN DIGIT MASK
	DAC*	BTOABP		/(RCHM-007) STORE DIGIT IN OUTPUT BUFFER.
	IDX	BTOABP		/(RCHM-007) BUMP OUTPUT POINTER TO NEXT WORD.
	LAC	BTOATP		/(RCHM-007) FETCH WORD FOR NEXT OCTAL DIGIT.
	ISZ	BTOALC		/(RCHM-007) 6 DIGITS YET?
	JMP	BT0010		/(RCHM-007) NOT YET.
	JMP*	BTOA		/(RCHM-007) ALL DONE.
 
/ VARIABLES NEEDED FOR CONVERSION.
 
BTOATP	0			/(RCHM-007) TEMPORARY STORAGE FOR NUMBER BEING CONVERTED.
BTOABP	0			/(RCHM-007) POINTER TO CURRENT OUTPUT BUFFER WORD.
BTOALC	-6			/(RCHM-007) DIGIT COUNTER. CONVERT 6 DIGITS AND QUIT.
	.TITLE	TELETYPE I/O ROUTINES.
/CLOSED SUBROUTINES FOR TYPEWRITER INPUT AND OUTPUT.
  
  
/SUBROUTINE TYPOUT, SET UP AND ISSUE CAL FOR IOPS ASCII OUTPUT MESSAGE.
/CALL:	LAW OUTMSG	/START ADDRESS (HEADER WORD 0) OF MESSAGE TO PRINT.
/	JMS TYPOUT	/GO TO TYPOUT.
TYPOUT	0		/ENTRY TO TYPOUT.
	JMS GETBNK	/GET SOME EPC BITS.
	DAC TTOUT		/INSERT 15-BIT ADDRESS IN CAL SEQUENCE.
	TTOCAL		/IOPS MODE WRITE TO TTY.
TAB	11		/..
TTOUT	0		/START OF LINE BUFFER.
SRCNAM	.SIXBT 'SRC'	/WORD COUNT -- IGNORED BY TELETYPE HANDLER.
	TTOCAL		/WAIT FOR PRINTING TO FINISH.
C12	12		/..
	JMP* TYPOUT	/RETURN TO CALLER.
  
/SUBROUTINE TYPEIN, SET UP AND ISSUE CAL FOR IOPS ASCII INPUT LINE.
/CALL:	LAW INBUFF	/WHERE TO PUT INCOMING LINE.
/	JMS TYPEIN	/GO TO TTY READER.
TYPEIN	0		/ENTRY TO TYPEIN.
	JMS GETBNK	/INSERT EXTENDED-MEMORY BITS.
	DAC TTIN		/GIVE TRUE (15-BIT) ADDRESS TO CAL SEQUENCE.
	TTICAL		/ISSUE CAL.
	10		/READ.
TTIN	0		/ADDRESS OF LINE BUFFER.
	-BUFLEN		/DON'T OVERFLOW BUFFER.
	TTICAL		/WAIT FOR USER TO FINISH.
	12		/..
	JMP* TYPEIN	/RETURN TO CALLER.
  
SETNAM	0
	DAC ERNAME
	LAW 40		/*****
	DAC EXP6SW	/*****
	LAC* ERNAME
	JMS EXPND6
	ISZ ERNAME
	LAC* ERNAME
	JMS EXPND6
	LAW 40
	JMS PUTCHR
	ISZ ERNAME
	LAC* ERNAME
	JMS EXPND6
	LAW -1
	DAC* OUTPTR
	LAC NOPLIT	/*****
	DAC EXP6SW	/*****
	JMP* SETNAM
ERNAME
ERWORD
TYDEV	0		/NAME TO TTY(0) OR DAT 3(NON-0)
TYPTR2	0		/ADDRESS OF OUTPUT ARRAY.
/SUBROUTINE TYONCH, OUTPUT SINGLE CHARACTER IN AC.
/NO WAIT REQUIRED BEFORE STORING C(AC) IN SINGCH.
/CALL:	LAW CHAR  	/CHARACTER TO BE TYPED IN AC(11-17).
/	JMS TYONCH	/GO TO TYONCH.
TYONCH	0		/ENTRY TO TYONCH.
	DAC SINGCH	/STORE CHAR TO TYPE IN IMAGE ASCII LINE BUFFER.
	TTOCAL+1000	/IMAGE MODE WRITE TO TTY.
	11		/..
ADR000	CHRMS		/ADDRESS OF OUTPUT MESSAGE.
CHRCT	0		/WORD COUNT -- IGNORED BY TELETYPE HANDLER.
	JMP* TYONCH	/RETURN TO CALLER.
CHRMS	002003		/HEADER WORD 0: 2 PAIRS, IMAGE ASCII.
C3000	3000		/CHECKSUM -- IGNORED BY TELETYPE HANDLER.
SINGCH	0		/CHARACTER TO BE TYPED IN BITS 11-17.
C177	177		/RUBOUT WILL TURN OFF TYPING.
  
/SUBROUTINE TYPRTN, PRODUCE CARRIAGE-RETURN AND LINE-FEED ON TELETYPE.
/CALL:	JMS TYPRTN
TYPRTN	0		/ENTRY TO TYPRTN.
OCTNUM=TYPRTN		/GETOCT: RESULTS REGISTER.
	TTOCAL		/OUTPUT CAL TO TELETYPE HANDLER.
C6	6		/.CLOSE WILL GENERATE CR/LF.
	JMP* TYPRTN	/RETURN TO CALLER.
	.EJECT
/SUBROUTINE GETBNK, ADD EXTENDED MEMORY BITS REFERENCING CURRENT
/BANK OR PAGE TO 13 OR 12 BIT ADDRESS IN AC.
/CALL:	LAW ADDR		/GET ADDRESS TO BE MODIFIED.
/	JMS GETBNK	/CALL GETBNK.
GETBNK	0		/ENTRY TO GETBNK.
CWCHRC=GETBNK		/GETCOM: MAXIMUM CHARACTERS POSSIBLE IN LEGAL COMMAND WORD.
	AND MSKADR	/EXTRACT ADDRESS FROM AC.(MSKADR=17777 OR 7777
	DAC GBADR		/SAVE TEMPORARILY.
	LAC GETBNK	/GET ENTRY.
	AND MSKEPC	/EXTRACT EPC BITS.(MSKEPC=60000 OR 70000
	XOR GBADR		/NOW RETRIEVE ADDRESS.
	JMP* GETBNK	/EXIT WITH 15-BIT ADDRESS IN AC.
GBADR	0
MSKADR	17777
MSKEPC	60000
/SUBROUTINE GETCOM, EXTRACT CONTROL WORD FROM TYPED INPUT LINE.
/IGNORES LEADING BLANKS IN STRING AND TERMINATES ON FIRST FOLLOWING
/BLANK OR END-OF-LINE. IF STRING BEING EXTRACTED EXCEEDS SEVEN CHARACTERS
/IN LENGTH, THE RIGHTMOST OVERFLOW CHARACTERS ARE THROWN AWAY. TOTAL
/CHARACTERS IN STRING EXTRACTED IS RETURNED TO THE CALLER IN THE AC.
GETCOM	0		/ENTRY TO GETCOM.
NPAIRS=GETCOM		/PUTLIN: TEMPORARY STORAGE.
	LAC CWDLIT	/POINTER TO START OF CONTROL-WORD ARRAY.
	DAC CWDPTR	/SAVE AS CURRENT-CHARACTER POINTER.
	LAW -12		/LENGTH OF CONTROL-WORD ARRAY (CWD).
	DAC CWCHRC	/SAVE AS MAXIMUM-CHARACTERS COUNTER.
	DZM NCHARS	/ZERO TOTAL CHARACTERS IN CONTROL-WORD STRING.
	CLL!CML		/INDICATE NO CHARACTERS ENCOUNTERED YET.
GTNXT	JMS NXTCHR	/GET NEXT CHARACTER FROM INPUT LINE.
	JMP GTCLOS	/NO MORE CHARACTERS, CLOSE OUT ARRAY.
	SAD BLANK		/SUCCESS. IS CHARACTER A BLANK?
	JMP BLKFND	/YES, MAKE SURE SOME DATA PRECEDED IT.
	CLL
	SAD COMMA
	JMP BLKFND
	ISZ CWCHRC	/BUMP MAXIMUM-CHARACTERS-ALLOWED.
	JMP GTCPUT	/NO OVERFLOW YET, PUT CHARACTER AWAY.
	CLC		/SEVEN CHARACTERS INSERTED, DON'T ALLOW ANY MORE.
	DAC CWCHRC	/RESET CWCHRC TO -1.
	JMP GTNXT		/THEN GO LOOK FOR BLANK OR TERMINATOR.
/COME HERE TO INSERT DATA CHARACTER IN CWD ARRAY.
GTCPUT	DAC* CWDPTR	/PUT CHARACTER AWAY.
	ISZ CWDPTR	/BUMP POINTER FOR NEXT TIME.
	ISZ NCHARS	/AND BUMP CHARACTERS PROCESSED.
	JMP GTNXT		/THEN GO FOR NEXT CHARACTER.
/COME HERE ON BLANK FOUND IN INPUT LINE.
BLKFND	SZL!CLA!CMA	/SKIP IF THIS  S NOT A LEADING BLANK.
	JMP GTNXT		/LEADING BLANK, IGNORE IT.
GTCLOS	DAC* CWDPTR	/NOT LEADING BLANK, THEN TERMINATE STRING (AC = -1 NOW).
	LAC NCHARS		/PICK UP TOTAL CHARACTERS IN STRING.
	JMP* GETCOM	/AND RETURN TO CALLER.
CWDPTR	0
CWD	.BLOCK 12		/ROOM FOR LONGEST LEGAL CONTROL WORD AND TERMINATOR.
/SUBROUTINE NXTCHR, RETURN NEXT 7-BIT CHARACTER FROM UNPACKED INPUT
/ARRAY. NXTPTR MUST BE SET TO BEGINNING OF ARRAY BEFORE FIRST CALL.
/CALL:	JMS NXTCHR	/GO TO NXTCHR.
/	JMP DONE		/RETURN HERE IF END-OF-LINE ENCOUNTERED.
/	DAC CHAR		/RETURN HERE WITH CHARACTER IN AC.
NXTCHR	0		/ENTRY TO NXTCHR.
TNUM=NXTCHR		/GETNUM: TEMPORARY STORAGE.
	LAC* NXTPTR	/GET NEXT CHARACTER.
	SPA		/TERMINATOR?
	JMP* NXTCHR	/YES, RETURN IMMEDIATELY.
	ISZ NXTPTR	/OTHERWISE BUMP POINTER FOR NEXT TIME.
	ISZ NXTCHR	/AND BUMP RETURN ADDRESS.
	JMP* NXTCHR	/THEN RETURN TO CALLER WITH CHARACTER IN AC 11-17.
BLANK	40
COMMA	54
/SUBROUTINE GETNUM, RETURN BINARY VALUE IN AC OF THE DECIMAL
/ARGUMENT IN THE CONTROL WORD STRING. NUMBER IS RETURNED IN NEGATIVE (2'S
/COMPLEMENT) FORM. IF NO PARAMETER IS PRESENT, AC = 777777. THE
/APPEARANCE OF ANY NON-NUMERIC IN THE PARAMETER STRING CAUSES
/TRANSFER OF CONTROL TO ILLCWD AND SUBSEQUENT DISREGARD OF THE
/ENTIRE COMMAND.
GETNUM	0		/ENTRY TO GETNUM.
	LAC CWDLIT	/SET DIGIT POINTER TO
	DAC NUMPTR	/BEGINNING OF CONTROL-WORD STRING.
	DZM BNUM		/SET INITIAL RESULT TO ZERO.
GTNLP	LAC* NUMPTR	/ENTER MAIN LOOP, GET NEXT DIGIT FROM INPUT STREAM.
	SPA		/TERMINATOR CHARACTER?
	JMP GTNRTN	/YES, GO TO RETURN.
	AND (17		/NO, MASK OFF NUMERICS.
	DAC TNUM		/SAVE NUMERICS.
	XOR* NUMPTR	/ZERO NUMERICS, REINSERT ZONE BITS.
	XOR (60		/THEN ZERO ZONE BITS. THIS ONLY SEEMS TEDIOUS.
	SZA		/BITS 2 AND 3 ON, BIT 1 OFF: NUMBER PRESENT.
BADARG	JMP TYQUES	/NON-NUMBER OTHERWISE. GO COMMENT.
	LAC BNUM		/GET VALUE COMPUTED SO FAR, THEN MULTIPLY BY 10.
	CLL!RAL		/FORM BNUM * 2.
	RTL		/BNUM * 8.
DECMK1	ADD BNUM		/BNUM * 9.
	ADD BNUM		/BNUM * 10.
	ADD TNUM		/BNUM PLUS CURRENT DIGIT.
	DAC BNUM		/NEW VALUE.
	ISZ NUMPTR	/BUMP POINTER TO NEXT DIGIT.
	JMP GTNLP		/LOOP TILL DONE.
GTNRTN	LAC BNUM		/ALL FINISHED, GET FINAL VALUE.
	SZA!CMA		/IF BNUM .E. 0, BNUM = 1.
	TAD ONE		/IF BNUM .G. 0, FORM 2'S COMPLEMENT.
	JMP* GETNUM	/RETURN TO CALLER WITH RESULT IN AC.
BNUM	0
NUMPTR	0
  
/SUBROUTINE TWOS, FORM TWO'S COMPLEMENT OF NUMBER IN THE AC.
TWOS	0
	TAD FENCE		/FENCE = 777777.
	CMA
	JMP* TWOS
  
/SUBROUTINE FXUNIT, MAKE UNIT NUMBER LAST REFERENCED (IN VARIABLE
/"UNIT") A PRINTABLE ASCII CHARACTER AND PUT IT IN IMAGE ASCII BUFFER.
FXUNIT	0
	LAC UNIT		/PICK UP UNIT NUMBER.
	RTL		/MOVE IT TO BITS 15-17.
	RTL		/..
	AND (7		/THROW AWAY JUNK.
	TAD (60		/INSERT ZONE BITS.
	DAC PRUNIT	/AND SAVE ASCII UNIT NUMBER.
	JMP* FXUNIT	/THEN EXIT TO CALLER.
PRUNIT	0
	56
	777762
  
/MESSAGES OUT.
	.IFUND	ADSS		/(RCHM-011) SHOULD WE GENERATE DOS HELLO MESSAGE?
BEGMES	ENDBGM-.*400+2
NXTPTR	0
	.SYSID <	.ASCII 'MTDUMP >,<000'<15>> /(RCHM-114)
	.ENDC			/(RCHM-011)
	.IFDEF	ADSS		/(RCHM-011) SHOULD WE GENERATE ADSS HELLO MESSAGE?
BEGMES	ENDBGM-.*400+2		/(RCHM-011) HWP FOR ADSS HELLO MESSAGE.
NXTPTR	0			/(RCHM-011)
	.ASCII	'MTDUMP V5B000'<15>	/(RCHM-012) BEGIN USING DOS HELLO FORMAT.
	.ENDC			/(RCHM-011)
ENDBGM=.
BFSMES	ENDBFS-.*400+2
EOTSW	0
	.ASCII 'BUFSIZ: '<175>
ENDBFS=.
RBRACK	002002
	0
	.ASCII '>'<175>
QUESMK	002002
	0
	.ASCII '?'<15>
OFLMES	ENDOFM-.*400+2
UNIT1	0	/INPUT UNIT FOR COPY REQUEST.
	.ASCII '*LONG INPUT RECORD.'<15>
ENDOFM=.
EOTMES	ENDETM-.*400+2
UNIT2	0	/OUTPUT UNIT FOR COPY REQUEST.
	.ASCII '*PHYSICAL EOT'<175>
ENDETM=.
EOFMES	ENDEFM-.*400+2
M02DEV	0
	.ASCII '*END OF FILE'<175>
ENDEFM=.
FMTERR	ENDFMT-.*400+2
YES	.SIXBT 'YES'
	.ASCII '*DIRECTORY FORMAT ERROR.'<15>
ENDFMT=.
DIRMES	ENDDRM-.*400+2
DEFNAM	.SIXBT 'LST'
	.ASCII 'DIRECTORY LISTING, UNIT '<175>
ENDDRM=.
TFILMS	ENDTFM-.*400+2
	0
	0
	0
	.ASCII ' TOTAL FILES.'<12><15>
ENDTFM=.
AFILMS	ENDAFM-.*400+2
FILNAM	0
PRSW	0	/SWITCHES FOR PARITY AND
DNSW	0	/  DENSITY SETTINGS GIVEN IN FORMAT REQUEST.
	.ASCII ' ACTIVE FILES.'<15>
ENDAFM=.
FNDMES	ENDFDM-.*400+2
Y	.SIXBT 'Y@@'	/SINGLE-CHARACTER AFFIRMATIVE RESPONSE.
	.ASCII 'FOUND ON DUMP DEVICE: '<175>
ENDFDM=.
DLQUES	ENDDLQ-.*400+2
INDIR	0
DBITS=INDIR	/DENSITY INDICATOR FOR FORMAT REQUEST.
	.ASCII 'DO YOU WISH TO DELETE IT?'<15>
ENDDLQ=.
PRMERR	ENDPRM-.*400+2
PARITY	0	/PARITY FOR FORMAT REQUEST.
	.ASCII 'PERMANENT READ ERROR ENCOUNTERED'<15>
ENDPRM=.
BOTMES	ENDBOM-.*400+2
DCWORD	0
PRCSW=DCWORD
DNSITY=DCWORD	/DENSITY (IN  BITS 7-8) FOR FORMAT .MTAPE.
	.ASCII '*BOT'<175>
ENDBOM=.
ENCOUN	0
DECPNT	DECNUM
	.ASCII ' ENCOUNTERED, UNIT '<175>
/BUFFERS...
WRBUF1	.BLOCK 46
WRBUF2	.BLOCK 46
TYLINE	.BLOCK 46
OUTLIN	.BLOCK 120
	.END	INLIST		/(RCHM-010)
