Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99g-bb - filcom.c09
There is 1 other file named filcom.c09 in the archive. Click here to see a list.
 REP 1/1	;09C1
	TITLE	FILCOM   PROGRAM TO COMPARE FILES - V21C(75)
	SUBTTL	BOWERING/DMN/TWE/DMN/LCR/LLN/ILG/MFB/MS/PY/BAH	2-Nov-83
 WIT
	TITLE	FILCOM   PROGRAM TO COMPARE FILES - V22(106)
	SUBTTL	BOWERING/DMN/TWE/DMN/LCR/LLN/ILG/MFB/MS/PY/BAH	19-Sep-84
 REP 28/1	;09C2
		VFILCM==21		;VERSION NUMBER
		VUPDATE==3		;DEC UPDATE
		VEDIT==75		;EDIT LEVEL
 WIT
		VFILCM==22		;VERSION NUMBER
		VUPDATE==0		;DEC UPDATE
		VEDIT==106		;EDIT LEVEL
 REP 43/1	;09C3

	TWOSEG
	RELOC 400000

	COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1970,1984.


 WIT
		.DIRECTIVE	FLBLST		;[100]
		SALL				;[100]

		TWOSEG
		RELOC 400000	;[101] IF MOVED UP, CHANGE BLANK LINE IM MEMORY BIT

	COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1970,1984.
 DEL 60/1	;09C4
	AL==1		;ASCII LINE MODE
	BIN==14		;BINARY MODE
 REP 80/1	;09C5

	TAB==11
	LF==12
	FF==14
	CR==15
	VT==13		;VERTICAL TAB

 WIT
 DEL 110/1	;09C6
	WPL==^D100/5+1		;MEMORY WORDS/LINE
 DEL 117/1	;09C7
	.PTFCN==0		;OFFSET TO PATH. UUO FUNCTION
	.PTSWT==1		;  "     "  "     "  SWITCH
	.PTPPN==2		;  "     "  "     "  PPN


	;VALUES FOR EXE FILE DIRECTORY
	SV.DIR==1776		;DIRECTORY CODE
	SV.END==1777		;END BLOCK
 INS 53/3	;09C8
 INS 103/3	;09C9
 INS 142/3	;09C10
	;Start version 22
	;76	None. 6-Jun-84.		TL.
	;	Merge code from ADP to add /O support.  Modify it so output file
	;	is same as before if no /O.  (For SIRUS, others who read FILCOM output.)
	;
	;77	None. 25-Jul-84.	TL.
	;	Fix /O/B test for page break.
	;
	;100	None. 25-Jul-84.	TL.
	;	More of edit 74.  Also, deal with CCL RUN UUOs.
	;
	;101	None. 25-Jul-84.	TL.
	;	Try to get /U without /L to be a bit brighter.
	;102	10-34246	31-Jul-84	BAH
	;	If the right square bracket of the second input file spec is missing
	;	in the command "=A.B[C,D,E],A.B[F,G]", FILCOM gives a LOOKUP error 23.
	;	Edit 50 did not catch all cases.
	;
	;103	Eklund	8-Aug-84	TL
	;	/O format didn't pass muster.  I'd rather switch than fight.
	;
	;104	WXD	28-Aug-84	TL
	;	/O didn't count label offsets right in all cases.  Throw
	;	out the ADP method, and invent our own bugs.
	;
	;105	TARL	18-Sep-84	TL
	;	Revoke edit 41 if /T specified.  This makes monitor builds on
	;	the -10 work better.
	;
	;106	RAP	19-Sep-84	TL
	;	Fix obscure Ill mem ref in edit 101.
	;
 REP 4/4	;09C11
	FILCOM:	SETZM	XITFLG		;[45] ^Z HAS NOT BEEN TYPED
 WIT
	FILCOM:	JFCL			;[100] IN CASE OF CCL RUN
		SETZM	XITFLG		;[45] ^Z HAS NOT BEEN TYPED
 DEL 7/5	;09C12

		SETZM	FILCNT		;DOING FIRST FILE (OUTPUT)
 REP 18/6	;09C13
		CAIG	C,33		;[20] BUT ONLY ALLOW VALID EOF
		CAIGE	C,LF		;[20] IF GREATER THAN ESC OR LESS THAN FF
		JRST	CTLSER		;[20] GIVE ERROR
		CAILE	C,CR		;[20] ONLY ALLOW LF, VT, FF, CR
		CAIL	C,32		;[20] ^Z AND ESC
 WIT
		CAIG	C,.CHESC	;[20] [100] BUT ONLY ALLOW VALID EOF
		CAIGE	C,.CHLFD	;[20] [100] IF GREATER THAN ESC OR LESS THAN FF
		JRST	CTLSER		;[20] [100] GIVE ERROR
		CAILE	C,.CHCRT	;[20] [100] ONLY ALLOW LF, VT, FF, CR
		CAIL	C,.CHCNZ	;[20] [100] ^Z AND ESC
 REP 33/6	;09C14
		MOVEI	0,AL		;SET UP INPUT DATA MODE
 WIT
		MOVEI	0,.IOASL	;[100] SET UP INPUT DATA MODE
 INS 46/6	;09C15
 REP 61/6	;09C16
		MOVEI	0,AL		;INIT DEVICE IN ASCII LINE MODE
 WIT
		MOVEI	0,.IOASL	;[100] INIT DEVICE IN ASCII LINE MODE
 REP 82/6	;09C17
	SETBIN:	SETSTS	2,BIN		;CHANGE TO BINARY MODE
	NOINP2:	MOVEI	0,(POINT 36,,35)
		IOR	FR,T		;SET MODE BINARY
		SETSTS	1,BIN
		HRLM	0,INBUF1+1	;CHANGE FROM ASCII
		HRLM	0,INBUF2+1
	INICTL:	MOVEI	0,0		;INIT OUTPUT DEVICE
 WIT
	SETBIN:	SETSTS	IN2,.IOBIN	;[100] CHANGE TO BINARY MODE
	NOINP2:	MOVEI	0,(POINT 36,,35)
		IOR	FR,T		;SET MODE BINARY
		SETSTS	IN1,.IOBIN	;[100]
		HRLM	0,INBUF1+1	;CHANGE FROM ASCII
		HRLM	0,INBUF2+1
	INICTL:	MOVEI	0,.IOASC	;[100] INIT OUTPUT DEVICE
 REP 94/6	;09C18

		MOVE	TT,OUTDEV	;CAN OUTPUT DEVICE DO OUTPUT
		DEVCHR	TT,
		TLNN	TT,1
		JRST	ERRONO		;[24]NO
		TLNE	TT,10		;IS OUTPUT DEVICE  TTY?
 WIT
		MOVE	TT,OUTDEV	;CAN OUTPUT DEVICE DO OUTPUT
		DEVCHR	TT,
		TXNN	TT,DV.OUT	;[100]
		JRST	ERRONO		;[24]NO
		TXNE	TT,DV.TTY	;[100] IS OUTPUT DEVICE  TTY?
 INS 28/7	;09C19
		SETOM	LSTSYM+SYMLIN	;[104] MAKE SURE BEGINNING OF FILE IS LINE 0
 REP 24/8	;09C20
	;WHEN WE GET HERE WE HAVE DETECTD A DIFFERENCE
	;NOW THE PROGRAM WILL LOOK AHEAD TO TRY AND FIND THE NEXT TWO
	;MATCHING LINES

		AOS	DIFFLG		;SET "DIFFERENCE IN PROGRESS" FLAG
 WIT
	;WHEN WE GET HERE WE HAVE DETECTED A DIFFERENCE
	;NOW THE PROGRAM WILL LOOK AHEAD TO TRY AND FIND THE NEXT TWO
	;MATCHING LINES.

		SKIPN	OFSSWT		;[104] NEED TO SAVE CURRENT SYMBOL?
		 JRST	MAIN9		;[104] NO, DON'T
		MOVE	W1,[XWD LSTSYM,SAVSYM] ;[104] YES, KEEP SYMBOL AT START OF CONFLICT
		BLT	W1,SAVSYM+SSBLTE-1 ;[104] ...

	MAIN9:	AOS	DIFFLG		;SET "DIFFERENCE IN PROGRESS" FLAG
 REP 45/8	;09C21

 WIT
 INS 53/8	;09C22

 REP 58/8	;09C23
 WIT

 REP 29/9	;09C24
		PUSHJ	PP,PNTTXT	;ALL LINES ARE GONE FROM 1 FILE,
					;OUTPUT THE OTHER WITHOUT USING CORE
		JRST	MAIN

 WIT
		PUSHJ	PP,PRNTXT	;ALL LINES ARE GONE FROM 1 FILE,
					;OUTPUT THE OTHER WITHOUT USING CORE
		JRST	MAIN
 REP 39/9	;09C25
		MOVE	W1,[POINT 7,[ASCIZ /|
 WIT
		SKIPE	OFSSWT		;[103] /O?
		 SKIPN	W1,NOHDR	;[103] DID ONE FILE END SHORT?
		JRST	FIN1		;[103] NO
		TRNN	W1,-1		;[103] YES, FILE 1?
		 PUSHJ	PP,PRNSEP	;[103] YES - SEP GOES AFTER EOF

	FIN1:	MOVE	W1,[POINT 7,[ASCIZ /|
 REP 47/9	;09C26
		JRST	[ TLNN FR,USWBIT;[52] UNLESS WE ARE UPDATING
 WIT
		JRST	[ TLNN FR,USWBIT;[52] IF WE ARE UPDATING
			   SKIPE OPTSWT	;[105] OR USER WANTS FILE ANYHOW
			  JRST	FIN3	;[105] WE WANT TO KEEP THIS
 REP 12/10	;09C27
		PUSHJ	PP,COMPL	;COMPARE THEM
 WIT
	MULT20:	SKIPN	USWFLG		;[101] FUNNY /U?
		 JRST	MULT44		;[101] NO
		PUSHJ	PP,SETP		;[101] POINT TO LINES
		MOVEI	W3,400K		;[101] BLANK LINE IN MEMORY BIT
		TDNE	W3,0(W2)	;[101] IS THIS ONE?
		 JRST	MULT41		;[101] YES, SKIP IT
		TDNN	W3,0(W1)	;[101] CHECK THE OTHER FILE
		 JRST	MULT44		;[101] NOPE
		TRZA	FR,-1		;[101] GET ANOTHER LINE
	MULT41:	 HRRI	FR,1		;[101] FROM SOME FILE
		SETOM	GETCNT		;[101]
		SETOM	GETFIL		;[101]
		PUSHJ	PP,GLINE	;[101] READ
		SKIPGE	GETCNT		;[101] GOT ONE?
		 JRST	MULT4		;[101] NO, EOF
		JRST	MULT20		;[101] YUP, SEE IF ONE OF THEM IS BLANK

	MULT44:	PUSHJ	PP,COMPL	;COMPARE THEM
 REP 33/10	;09C28

	;GO BACK AND START COMPARING.
	;WHEN WE START COMPARING AGAIN THE LINE POINTERA WILL
 WIT
	;GO BACK AND START COMPARING.
	;WHEN WE START COMPARING AGAIN THE LINE POINTER WILL
 INS 6/11	;09C29
	;			BIT 18 OF WORD COUNT MEANS BLANK LINE IN CORE
 REP 25/11	;09C30
		MOVE	TT+2,[JRST SETON2]	;SET UP AC
		MOVE	TT+1,.+1	;SET UP AC
		SOJGE	W3,TT
				;TT/	ADD T,(T)	;ADD IN WORD COUNT FOR LINE
				;TT+1/	SOJGE W3,.-1	;MORE LINES LEFT?
				;TT+2/	JRST SETON2	;NO
 WIT
		MOVE	TT+1,[TRZ  T,400K]	;[101] [106]
		MOVE	TT+3,[JRST SETON2]	;[101] SET UP AC
		MOVE	TT+2,.+1	;[101] SET UP AC
		SOJGE	W3,TT
				;TT/	ADD T,(T)	;ADD IN WORD COUNT FOR LINE
				;TT+1/	TRZ T,400K	;[101] CLEAR BLANK LINE BIT
				;TT+2/	SOJGE W3,TT	;MORE LINES LEFT?
				;TT+3/	JRST SETON2	;NO
 REP 36/11	;09C31

 WIT
 REP 11/12	;09C32
		MOVEI	C,174		;PRINT VERTICAL BAR IF
 WIT
		MOVEI	C,"|"		;[100] PRINT VERTICAL BAR IF
 REP 16/12	;09C33
		MOVEI	C,TAB		;PRINT A TAB
 WIT
		MOVEI	C,.CHTAB	;[100] PRINT A TAB
 REP 23/12	;09C34
		MOVEI	C,15
 WIT
		MOVEI	C,.CHCRT	;[100]
 REP 19/13	;09C35
		CAMG	W1,TOP(FR)	;HAVE WE GONE OVER THE TOP
		JRST	GLEXIT		;NO, LINE WAS AVAILABLE
		SOS	F1(FR)		;NOT CLEAR YET THAT A NEW LINE EXISTS
	GLINE1:	HRLS	PAGNUM(FR)	;SAVE PAGE # AT BEGINNING OF LINE
 WIT
		CAMLE	W1,TOP(FR)	;[76] HAVE WE GONE OVER THE TOP?
		JRST	GLINEB		;[76] NO LINE -- GO GET ONE
		JRST	GLNXIT		;[104] GOT IT IN CORE, GO AWAY

	GLINEA:	TLZ	C,400000	;[76] COUNT BLANK LINES
		TRNN	FR,-1		;[103] ONLY COUNT FOR FILE 1
		 CAIN	C,.CHFFD	;[76] [103] BUT NOT FORM-FEEDS
		CAIA			;[103] FILE 2 OR FFD
		 AOS	LSTSYM+SYMLIN	;[76] [104] COUNT LINES PAST SYMBOL
		SKIPA			;[76]

	GLINEB:	SOS	F1(FR)		;NOT CLEAR YET THAT A NEW LINE EXISTS
		HRLS	PAGNUM(FR)	;SAVE PAGE # AT BEGINNING OF LINE
 REP 27/13	;09C36
		JUMPL	C,GLINE1	;MINUS CHARS INDICATE BLANK LINES
 WIT
		JUMPL	C,GLINEA	;[76] MINUS CHARS INDICATE BLANK LINES
 REP 33/13	;09C37
		MOVE	W2,PAGNUM(FR)	;PICKUP PAGE # AT BEGINNING OF LINE
		HLLZM	W2,(W1)		;SAVE WITH THIS LINE
 WIT
		HLLZ	W2,PAGNUM(FR)	;[101] PICKUP PAGE # AT BEGINNING OF LINE
		SKIPGE	C		;[101] BLANK LINE?
		 TRO	W2,400K		;[101] YES, REMEMBER THE FACT
		MOVEM	W2,(W1)		;[101] SAVE WITH THIS LINE
 INS 14/14	;09C38
		IOR	W1,(W3)		;[101] PRESERVE BLANK LINE BIT
 REP 26/14	;09C39
		CAIE	T,11		;[33] IF A TAB, CHECK FURTHER
 WIT
		CAIE	T,.CHTAB	;[33] [100] IF A TAB, CHECK FURTHER
 REP 31/14	;09C40
		JRST	GLINE1		;[33] GET ANOTHER LINE
	GLEXIT:	AOS	GETCNT		;INDEX # LINES FOUND
		HRRZM	FR,GETFIL	;SAVE # OF THIS FILE
		POPJ	PP,

 WIT
		MOVEI	C,.CHLFD	;[104] THIS WASN'T A PAGE MARK
		JRST	GLINEA		;[33] [104] GET ANOTHER LINE
	GLEXIT:	PUSHJ	PP,GLSYMB	;[104] LINE IS NOW IN - GET A SYMBOL
	GLNXIT:	PUSHJ	PP,SETONE	;[101] FIND LINE POINTERS
		MOVE	W1,W1(FR)	;[101] ONLY THE ONE FOR CURRENT FILE
		MOVE	W1,0(W1)	;[101] CHECK BLANK BIT IN HEADER
		TRNE	W1,400K		;[101] TO SEE IF TO BE IGNORED
		 SKIPN	USWFLG		;[101] BUT ONLY IN FUNNY/U MODE
		CAIA			;[101] DON'T IGNORE
		 JRST	GLINE		;[101] DO
		AOS	GETCNT		;INDEX # LINES FOUND
		HRRZM	FR,GETFIL	;SAVE # OF THIS FILE
		POPJ	PP,		;[104] DONE.
 INS 1/15	;09C41
	;[76] HERE TO SEE IF THE CURRENT LINE HAS A SYMBOL DEFINITION (FOO:)

	GLSYMB:	SKIPE	OFSSWT		;[104] IF NOT /O
		 TRNE	FR,-1		;[104] OR THIS IS FILE 2
		POPJ	PP,		;[104] DO NOTHING
		PUSHJ	PP,SETONE	;[76] SET W1 TO CURRENT LINE'S TEXT
		MOVE	W2,[POINT 7,PSYMB] ;[76] WHERE WE CAN BUILD IT INTO
		SETZM	PSYMB		;[76] CLEAR IT OUT
		SETZM	PSYMB+1		;[76]
		MOVEI	W3,^D10		;[76] ARBITRARY MAX SYMBOL LENGTH OF 10 CHARACTERS
		SETZ	TT,		;[76] START WITH NO NNN$ LABEL SEEN

	GLSY.1:	ILDB	T,W1		;[76] FIRST EAT LEADING SPACES AND TABS
		CAIE	T,.CHTAB	;[76]
		CAIN	T," "		;[76]
		JRST	GLSY.1		;[76]
		SKIPA			;[76]  THEN SKIP FIRST ILDB WITH NON-SPACE

	GLSY.2:	ILDB	T,W1		;[76] SCAN THROUGH A SYMBOL
		JUMPE	T,GLSY.N	;[76] [104] IF NO : BEFORE EOL, NO SYMBOL

		CAIL	T,"a"		;[76] LOWER CASE?
		CAILE	T,"z"		;[76]
		SKIPA			;[76] NO
		SUBI	T,"a"-"A"	;[76] YES, CONVERT TO UPPER CASE
		JUMPG	TT,GLSY.3	;[76] IF HAVE ALREADY SEEN A LETTER,
					;[76] THEN CONTINUE BUILDING SYMBOL
		CAIL	T,"0"		;[76] A NUMBER?
		CAILE	T,"9"		;[76]
		JRST	GLSY.3		;[76] NO, LOOK FOR LETTER
		AOJL	TT,[MOVEI TT,1	;[76] IF HAVE ALREADY SEEN 999$ THEN SYMBOL IS SCREWY
			    JRST  GLSY.3] ;[76] SO JUST ACCUMULATE STANDARD SYMBOL
		SETO	TT,		;[76] MARK THAT HAVE SEEN DIGIT
		JRST	GLSY.S		;[76] AND STORE CHARACTER INTO SYMBOL

	GLSY.3:	CAIE	T,"$"		;[76] COULD IT BE A LOCAL PDP11 LABEL
		JRST	GLSY.4		;[76] NO, KEEP BUILDING LABEL
		AOJN	TT,[MOVEI TT,1	;[76] IS PDP11 LABEL IF HAVE SEEN ONLY DIGITS
			    JRST  GLSY.S] ;[76] HAVEN'T, SO JUST BUILD SCREWY LABEL
		HRREI	TT,-2		;[76] MARK THAT HAVE SEEN 999$ LABEL
		JRST	GLSY.S		;[76] AND GO STORE "$" INTO LABEL
	GLSY.4:	CAIE	T,"."		;[76] IS THIS ONE OF THE SPECIAL SYMBOL
		CAIN	T,"%"		;[76]  CHARACTERS?
		JRST	GLSY.S		;[76] YES, GO STORE INTO LABEL
		CAIL	T,"A"		;[76] IS IT A LETTER?
		CAILE	T,"Z"		;[76]
		SKIPA			;[76] NO
		JRST	GLSY.S		;[76] YES, GO STORE INTO LABEL
		CAIN	T,":"		;[76] THE END OF A SYMBOL DEFINITION?
		JRST	GLSY.E		;[76] YES, GO END THIS LABEL
		JRST	GLSY.N		;[76] [104] MUST NOT BE A LABEL

	GLSY.S:	IDPB	T,W2		;[76] HAVE ANOTHER SYMBOL CHARACTER, BUILD SYMBOL
		SOJG	W3,GLSY.2	;[76] BUT ONLY UP TO 10 CHARACTERS
		JRST	GLSY.N		;[76] [104] MUST NOT BE A SYMBOL

		;HERE, WE HAVE A SYMBOL.  FIGURE OUT WHICH SORT, AND STORE IT.

	GLSY.E:	HRRZ	W1,DOLPTR	;[76] [103] FIRST TRY FOR 11 LOCAL LABEL
		AOJL	TT,GLSY.6	;[76] IT IS IF SWITCH WAS -2
		SETZM	0(W1)		;[76] OTHERWISE IT'S NOT, FORGET ANY FROM
		SETZM	1(W1)		;[76]  PREVIOUS LOCAL SYMBOL BLOCK
		HRRZ	W1,SYMPTR	;[76] [103]  AND SWITCH TO SYMBOL POINTER
	GLSY.6:	MOVE	T,PSYMB		;[76] COPY SYMBOL TO WHEREEVER WE NEED IT
		MOVEM	T,0(W1)		;[76]
		MOVE	T,PSYMB+1	;[76]
		MOVEM	T,1(W1)		;[76]
		SETOM	LSTSYM+SYMLIN	;[76] [103] [104] RESTART LINES SINCE SYMBOL COUNT

		;HERE TO ACCOUNT FOR THIS LINE

	GLSY.N:	PUSHJ	PP,SETONE	;[77] POINT TO LINE AGAIN
		HLRZ	T,1(W1)		;[76] GET THE FIRST DATA WORD OUT
		TRZ	T,<BYTE (7)0,0,.CHDEL>_-^D18 ;[76] LESS THE PART OF THE THIRD BYTE
		CAIE	T,(BYTE (7).CHNUL,.CHFFD) ;[76] [103] UNLESS THIS IS A BLANK LINE W/FFD
		 AOS	LSTSYM+SYMLIN	;[76] [104] COUNT A LINE SEEN LAST SYMBOL
		POPJ	PP,		;[76]
 REP 28/15	;09C42
	NOR1:	CORE	T,		;CORE UUO
		SKIPA	T,ROOM		;FAIL
		JRST	NOR3		;SUCCESS
	NOR11:	JUMPG	T,NOR4		;ANY CORE LEFT AT ALL?
 WIT
		CORE	T,		;CORE UUO
		SKIPA	T,ROOM		;FAIL
		JRST	NOR3		;SUCCESS
		JUMPG	T,NOR4		;ANY CORE LEFT AT ALL?
 REP 5/16	;09C43
	NOR33:	TRNE	FR,1		;WHICH FILE NEEDED ROOM?
 WIT
		TRNE	FR,1		;WHICH FILE NEEDED ROOM?
 REP 13/16	;09C44
	NOR6:	MOVNS	T,ROOM		;FILE IS MOVING IN NEGATIVE DIRECTION
 WIT
		MOVNS	T,ROOM		;FILE IS MOVING IN NEGATIVE DIRECTION
 REP 41/16	;09C45
	NOR99:	POPJ	PP,
 WIT
		POPJ	PP,
 REP 11/17	;09C46
		JRST	.+4		;[33] NOT SEQ. #
		AOS	P1		;SKIP OVER SEQ. # AND
		ILDB	W1,P1		;[33] GET CHAR
		CAIN	W1,11		;[33] IS IT A TAB?
		ILDB	W1,P1		;[33] YES, EAT IT
 WIT
		JRST	COMPL5		;[33] [100] NOT SEQ. #
		AOS	P1		;SKIP OVER SEQ. # AND
		ILDB	W1,P1		;[33] GET CHAR
		CAIN	W1,.CHTAB	;[100] [33] IS IT A TAB?
	COMPL5:	ILDB	W1,P1		;[33] [100] YES, EAT IT

		;[100] HERE WITH FIRST GOOD CHAR FROM FILE 1 IN W1

 REP 20/17	;09C47
		CAIE	W2,11		;[33] IS IT A TAB?
		JRST	COMPL0		;[33] NO, DON'T EAT
		JRST	COMPL2		;[33] YES, DO EAT

 WIT
		CAIE	W2,.CHTAB	;[33] [100] IS IT A TAB?
		JRST	COMPL0		;[33] NO, DON'T EAT
		JRST	COMPL2		;[33] YES, DO EAT
 REP 35/17	;09C48
		CAIN	W1,TAB		;OR TAB?
 WIT
		CAIN	W1,.CHTAB	;[100] OR TAB?
 REP 41/17	;09C49
		CAIN	W2,TAB		;OR TAB?
 WIT
		CAIN	W2,.CHTAB	;[100] OR TAB?
 INS 9/18	;09C50
		SKIPE	OFSSWT		;[76] IF /OFFSET, 
		 PUSHJ	PP,PNTTAG	;[103] ADD THE TAG
 INS 16/18	;09C51

	;THIS ROUTINE IMBEDS "SYMBOL+N" IN THE ASTERISK LINES
	;THE "SYMBOL" MUST OCCUR WITHIN THE FIRST 10 CHARACTERS OF THE LINE

	PNTTAG:	MOVE	W1,[POINT 7,[ASCIZ / ;At /]]	;[76] [103] NOISE
		PUSHJ	PP,PRINT	;[76]
		MOVE	W3,@DOLPT1	;[76] [103] GET LOCAL SYMBOL NAME
		JUMPE	W3,PNTT.1	;[76] [103] SKIP THIS IF NO LOCAL SYMBOL THERE
		MOVE	W1,DOLPT1	;[76] [103] POINT BACK AT LABEL
		PUSHJ	PP,PRINT	;[76] [103] DO IT
		JRST	PNTT.2		;[103] MAIN SYMBOL COMES LATER

	PNTT.1:	MOVE	W1,SSPTR1	;[76] [103] NO LOCAL, USE MAIN NOW
		SKIPN	W2,(W1)		;[103] IF NULL
		 MOVE	W1,[POINT 7,[ASCIZ /top of file /]]	;[103] SAY SOMETHING
		PUSHJ	PP,PRINT	;[76] [103] GET IT OUT

	PNTT.2:	SKIPN	T,SAVSYM+SYMLIN	;[76] [103] GET NUMBER OF LINES SINCE LAST SYMBOL
		JRST	PNTT.3		;[76] [103] NONE, SEE IF NEED A MAIN SYMBOL
		MOVEI	C,"+"		;[76] SOME, PUT IN PLUS
		PUSHJ	PP,TYO		;[76]
		PUSHJ	PP,PNTDEC	;[76] TYPE NUMBER OF LINES PAST SYMBOL
		MOVEI	C,"L"		;[103]
		PUSHJ	PP,TYO		;[103]

	PNTT.3:	JUMPE	W3,CPOPJ	;[103] IF ONLY MAIN SYMBOL, NO QUALIFIER
		MOVE	W1,[POINT 7,[ASCIZ / following /]]	;[76] [103] ENCLOSE SYMBOL
		PUSHJ	PP,PRINT	;[76]
		MOVE	W1,SSPTR1	;[76] POINT AT MAIN SYMBOL
		PJRST	PRINT		;[76] [103] GET IT OUT
 REP 19/18	;09C52
	PNTTXT:	SETOM	TEMP		;START POINTER AT -1
		SETOM	PAGEN		;GUARANTEE PAGE # MISMATCH- THEREFORE PRINT IT
	PNTTX1:	AOS	W1,TEMP		;INDEX LINE COUNTER
 WIT
	PNTTXT:	SETOM	PAGEN		;[76] GUARANTEE PAGE # MISMATCH- THEREFORE PRINT IT
		SETOM	TEMP		;[76] START POINTER AT -1
	PNTTX2:	AOS	W1,TEMP		;[76] INDEX LINE COUNTER
 REP 34/18	;09C53
		JRST	PNTTX1		;FINISH OUT ALL LINES

 WIT
		JRST	PNTTX2		;[76] FINISH OUT ALL LINES


	;HERE WHEN ONE FILE IS SHORT, ONLY WANT *'S ONCE
	PRNTXT:	SKIPE	OFSSWT		;[103] NO SEP IF NOT /O
		 SKIPE	NOHDR		;[76] BEEN HERE BEFORE?
		JRST	PNTTXT		;[76] [103] YES, HOP INTO THE MIDDLE AND PRINT A LINE

		;FAKE A START OF CONFLICT

		MOVE	W1,[XWD LSTSYM,SAVSYM] ;[104] SAVE LAST LABEL
		BLT	W1,SAVSYM+SSBLTE-1 ;[104] ...

		;IF READING FROM FILE 2, PRINT THE SEPERATOR LINE ABOVE

		TRNE	FR,-1		;[103] FILE 2?
		 PUSHJ	PP,PRNSEP	;[103] SEPARATOR
		PUSHJ	PP,PNTTXT	;[76] [103] PRINT THE LINE
		HRROM	FR,NOHDR	;[76] [103] REMEMBER WE DID
		POPJ	PP,		;[76]
	PRNSEP:	MOVE	W1,[POINT 7,[ASCIZ /****/]] ;[103]
		PUSHJ	PP,PRINT	;[103]
		PUSHJ	PP,PNTTAG	;[103]
		PJRST	PCRLF		;[103]

	PNTDEC:	IDIVI	T,^D10		;[76] YE OLDE DECIMAL PRINT ROUTINE
		HRLM	TT,0(PP)	;[76]
		SKIPE	T		;[76]
		PUSHJ	PP,PNTDEC	;[76]
		HLRZ	C,0(PP)		;[76]
		ADDI	C,"0"		;[76]
		PUSHJ	PP,TYO		;[76]
		AOS	TEMP		;[76] COUNT THAT CHARACTER
		POPJ	PP,		;[76]
 REP 9/19	;09C54
		MOVEI	C,TAB		;PRINT TAB
		PUSHJ	PP,PCHART

	PRINT:	ILDB	C,W1		;GET CHARACTER
		JUMPN	C,.-2		;LOOP UNTIL A NULL SHOWS UP
 WIT
		MOVEI	C,.CHTAB	;[100] PRINT TAB

	PLINE3:	PUSHJ	PP,PCHART
	PRINT:	ILDB	C,W1		;GET CHARACTER
		JUMPN	C,PLINE3	;LOOP UNTIL A NULL SHOWS UP
 REP 34/19	;09C55
	PGNUM1:	IDIVI	C,12		;STANDARD DECIMAL PRINT ROUTINE
 WIT
	PGNUM1:	IDIVI	C,^D10		;[100] STANDARD DECIMAL PRINT ROUTINE
 REP 7/20	;09C56
		CAIL	C,11		;IS CHAR BETWEEN 11 (TAB) AND
		CAILE	C,15		;  15 (CARRIAGE RETURN), OR
 WIT
		CAIL	C,.CHTAB	;[100] IS CHAR BETWEEN 11 (TAB) AND
		CAILE	C,.CHCRT	;[100]   15 (CARRIAGE RETURN), OR
 REP 20/20	;09C57

 WIT
 REP 29/20	;09C58
		MOVEI	C,FF		;FOR NEW PAGE, ISSUE FORM FEED
 WIT
		MOVEI	C,.CHFFD	;[100] FOR NEW PAGE, ISSUE FORM FEED
 DEL 7/21	;09C59


 REP 56/21	;09C60


 WIT
 REP 88/21	;09C61
		ADDI	C,40		;CHANGE TO ASCII
 WIT
		ADDI	C," "-' '	;[100] CHANGE TO ASCII
 REP 1/22	;09C62
	CRLF:	MOVEI	C,15		;OUTPUT A CARRIAGE RETURN-LINE FEED
		PUSHJ	PP,TYO
		MOVEI	C,12		;NOW THE LINE FEED
 WIT
	CRLF:	MOVEI	C,.CHCRT	;[100] OUTPUT A CARRIAGE RETURN-LINE FEED
		PUSHJ	PP,TYO
		MOVEI	C,.CHLFD	;[100] NOW THE LINE FEED
 REP 8/22	;09C63
		CAIN	C,12		;LINE FEED?
 WIT
		CAIN	C,.CHLFD	;[100] LINE FEED?
 REP 22/23	;09C64
	TYPTAB:	MOVEI	C,TAB
 WIT
	TYPTAB:	MOVEI	C,.CHTAB	;[100]
 REP 16/25	;09C65
		CAIE	C,LF		;LINE FEED?
		CAIN	C,VT		;NO-VERTICAL TAB?
		JRST	EOL		;YES, RETURN WITH LINE-END FLAG SET
		CAIN	C,CR		;CARRIAGE RETURN?
		JRST	[SETOM CRSEEN(FR)	;[44] YES, POSSIBLY FLUSH
			 JRST GCHAR]	;[44] SO GO GET ANOTHER
		CAIN	C,FF		;IS IT A FORM FEED?
 WIT
		CAIE	C,.CHLFD	;[100] LINE FEED?
		CAIN	C,.CHVTB	;[100] NO-VERTICAL TAB?
		JRST	EOL		;YES, RETURN WITH LINE-END FLAG SET
		CAIN	C,.CHCRT	;[100] CARRIAGE RETURN?
		JRST	[SETOM CRSEEN(FR)	;[44] YES, POSSIBLY FLUSH
			 JRST GCHAR]	;[44] SO GO GET ANOTHER
		CAIN	C,.CHFFD	;[100] IS IT A FORM FEED?
 REP 27/25	;09C66
		MOVEI	C,CR		;[44] RETURN A CARRIAGE-RETURN
 WIT
		MOVEI	C,.CHCRT	;[44] [100] RETURN A CARRIAGE-RETURN
 REP 10/27	;09C67
	GETIC1:	CAIN	C,32		;[45] AN EOF TERMINATES A FILE NAME
		JRST	[SETOM	XITFLG	;[45]   AND CAUSES US TO EXIT LATER
			 JRST	TERM]	;[45] HANDLE WHAT WE HAVE
		CAILE	C,15		;[45] THIS IS ANOTHER WAY TO GET A FILE NAME
		CAIN	C,33		;ALT MODE?
 WIT
		CAIN	C,.CHCNZ	;[45] [100] AN EOF TERMINATES A FILE NAME
		JRST	[SETOM	XITFLG	;[45] [100]   AND CAUSES US TO EXIT LATER
			 JRST	TERM]	;[45] [100] HANDLE WHAT WE HAVE
		CAILE	C,.CHCRT	;[45] [100] THIS IS ANOTHER WAY TO GET A FILE NAME
		CAIN	C,.CHESC	;[100] ALT MODE?
 REP 37/27	;09C68
		TRC	C,40		;CONVERT TO SIXBIT
 WIT
		TRC	C," "^!' '	;[100] CONVERT TO SIXBIT
 REP 41/27	;09C69

 WIT
 REP 46/27	;09C70
		CAIE	C,176
		CAIN	C,175
		MOVEI	C,33		;CHANGE ALL ALT MODES TO NEW
		CAIN	C,"="
		MOVEI	C,"_"		;= WILL EVENTUALLY REPLACE _
		CAIL	C,"A"+40
		CAILE	C,"Z"+40
		JRST	.+2
		TRZ	C,40		;CHANGE LOWER CASE TO UPPER CASE
		CAIE	C," "		;SKIP BLANKS
		CAIN	C,TAB		;AND TABS
 WIT
		CAIE	C,.CHAL2	;[100]
		CAIN	C,.CHALT	;[100]
		MOVEI	C,.CHESC	;[100] CHANGE ALL ALT MODES TO NEW
		CAIN	C,"="
		MOVEI	C,"_"		;= WILL EVENTUALLY REPLACE _
		CAIL	C,"a"		;[100]
		CAILE	C,"z"		;[100]
		 CAIA			;[100]
		TRC	C,"a"^!"A"	;[100] CHANGE LOWER CASE TO UPPER CASE
		CAIE	C," "		;[100] SKIP BLANKS
		CAIN	C,.CHTAB	;[100] AND TABS
 REP 7/28	;09C71
	TERM1:	CAIE	ACDEL,"."	;IF PERIOD,
 WIT
		CAIE	ACDEL,"."	;IF PERIOD,
 INS 16/30	;09C72
		CAIN	C,"O"		;[76] WANT SYMBOL OFFSETS?
		JRST	[SETOM	OFSSWT	;[76] YES
			 JRST	GETIOC]	;[76] GET NEXT PART OF COMMAND
		CAIN	C,"T"		;[105] WANT FILE ALWAYS?
		 JRST	[SETOM	OPTSWT	;[105] YES
			 JRST	GETIOC]	;[105] ON WITH COMMAND
 REP 41/30	;09C73

 WIT
 INS 19/31	;09C74
		PUSHJ	PP,CHKEOL	;[102] END OF LINE?
		JRST	TERM		;[102] YES, CONTINUE SCANNING
 REP 27/31	;09C75
		CAIN	C,33		;[50] ESCAPE?
		JRST	TERM		;[50] YES, DONE WITH THIS
		CAIE	C,32		;[50] MAYBE AN END OF FILE?
		CAIG	C,15		;[50] LF, FF, ETC.?
 WIT
		PUSHJ	PP,CHKEOL	;[102] END OF LINE?
 INS 42/31	;09C76

	;CHKEOL - CALL HERE TO CHECK FOR END OF LINE CHARACTER.  RETURN IF END OF LINE,
	;	SKIP RETURN IF NOT.

	CHKEOL:	CAIN	C,.CHESC	;[50] [100] ESCAPE?
		POPJ	PP,		;YES.
		CAIE	C,.CHCNZ	;[50] [100] MAYBE AN END OF FILE?
		CAIG	C,.CHCRT	;[50] [100] LF, FF, ETC.?
		POPJ	PP,		;YES.
		JRST	CPOPJ1		;NOT END OF LINE.
 REP 85/31	;09C77
	EAT:	CAIG	C,14		;[45] IN THE RANGE OF FORM FEED
		CAIGE	C,12		;[45] DOWN TO LINE FEED?
		CAIN	C,33		;[45] NO, IS IT AN ALTMODE?
		POPJ	PP,		;[45] YES! RETURN WITH EOL CHAR
		CAIN	C,7		;[45] IS IT A ^G?
		POPJ	PP,		;[45] YES, THAT ENDS LINE TOO
		CAIE	C,32		;[45] IS IT A ^Z?
 WIT
	EAT:	CAIG	C,.CHFFD	;[45] [100] IN THE RANGE OF FORM FEED
		CAIGE	C,.CHLFD	;[45] [100] DOWN TO LINE FEED?
		CAIN	C,.CHESC	;[45] [100] NO, IS IT AN ALTMODE?
		POPJ	PP,		;[45] YES! RETURN WITH EOL CHAR
		CAIN	C,.CHBEL	;[45] [100] IS IT A ^G?
		POPJ	PP,		;[45] YES, THAT ENDS LINE TOO
		CAIE	C,.CHCNZ	;[45] [100] IS IT A ^Z?
 REP 52/32	;09C78

 WIT
 REP 92/32	;09C79
		JRST	PRETTY		;[51] CLEAN UP HEADER AND RETURN
 WIT
	;	JRST	PRETTY		;[51] CLEAN UP HEADER AND RETURN
 REP 1/33	;09C80
	HEAD8:	MOVEI	C,0		;PUT NULL INTO BUFFER
 WIT
	HEAD8:	MOVEI	C,.CHNUL	;[100] PUT NULL INTO BUFFER
 REP 12/33	;09C81
		ADDI	C,40		;FOR SIXBIT, CONVERT TO ASCII
 WIT
		ADDI	C," "-' '	;[100] FOR SIXBIT, CONVERT TO ASCII
 REP 45/35	;09C82

 WIT
 DEL 1/36	;09C83

 REP 12/37	;09C84
		CAIE	T,SV.DIR	;IS THIS A PROPER EXE FILE?
 WIT
		CAIE	T,.SVDIR	;[100] IS THIS A PROPER EXE FILE?
 REP 35/37	;09C85
		CAIN	T,SV.END	;END BLOCK?
 WIT
		CAIN	T,.SVEND	;[100] END BLOCK?
 INS 44/37	;09C86
 REP 87/37	;09C87
	EXLUP2:	tlnn	fr,eof2sw	;don't compare if only 1 file [27]
 WIT
		TLNN	FR,EOF2SW	;DON'T COMPARE IF ONLY 1 FILE [27]
 DEL 94/37	;09C88


 REP 23/38	;09C89



 WIT
 DEL 1/39	;09C90

 INS 1/44	;09C91
	SYMPTR:	POINT	7,LSTSYM+SYMBOL	;[76] [104] POINTER TO LAST SYMBOL
	DOLPTR:	POINT	7,LSTSYM+$SYMBL	;[76] [104] POINTER TO LAST LOCAL SYMBOL
	SSPTR1:	POINT	7,SAVSYM+SYMBOL	;[76] [104] LAST SYMBOL BEFORE CONFLICT
	DOLPT1:	POINT	7,SAVSYM+$SYMBL	;[76] [104] LAST LOCAL SYMBOL BEFORE CONFLICT

 INS 40/44	;09C92
 REP 88/44	;09C93

 WIT
	OFSSWT:	BLOCK	1		;[76] SET IF LABEL OFFSETS WANTED
	OPTSWT:	BLOCK	1		;[105] /T (KEEP OUTPUT FILE) SPECIFIED

	LSTSYM:	PHASE	0		;[104] LAST SYMBOL SEEN IN INPUT BASE FILE
	SYMBOL:	BLOCK	2		;[76] LAST SYMBOL SEEN IN FILE 1
	$SYMBL:	BLOCK	2		;[76] LAST LOCAL SYMBOL SEEN IN FILE 1
	SYMLIN:	BLOCK	1		;[76] NUMBER OF LINES SEEN SINCE LAST SYMBOL
	SSBLTE==.-SYMBOL		;[76] LENGTH FOR BLT'S
		DEPHASE

	SAVSYM:	BLOCK	SSBLTE		;[104]

	NOHDR:	BLOCK	1		;[76] -1 IF UNEQUAL LENGTH FILES, PRINTED *******
	PSYMB:	BLOCK	2		;[76] COPY OF SYMBOL WHILE SEEING IF IT IS ONE
 SUM 148778