Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - filcom.c11
There are no other files named filcom.c11 in the archive.
 REP 1/1	;11C1
	TITLE	FILCOM   PROGRAM TO COMPARE FILES - V22(106)
	SUBTTL	BOWERING/DMN/TWE/DMN/LCR/LLN/ILG/MFB/MS/PY/BAH	19-Sep-84
 WIT
	TITLE	FILCOM   PROGRAM TO COMPARE FILES - V22(111)
	SUBTTL	BOWERING/DMN/TWE/DMN/LCR/LLN/ILG/MFB/MS/PY/BAH	3-Jun-85
 REP 7/1	;11C2
	;COPYRIGHT (C) 1970,1979,1981,1984 BY
 WIT
	;COPYRIGHT (C) 1970,1979,1981,1985 BY
 REP 30/1	;11C3
		VEDIT==106		;EDIT LEVEL
 WIT
		VEDIT==111		;EDIT LEVEL
 REP 28/2	;11C4
	LPDL==20	;LENGTH OF PUSH DOWN LIST
 WIT
	LPDL==50	;LENGTH OF PUSH DOWN LIST(HELPER NEEDS MORE THAN 20)
 INS 20/8	;11C5
	;107	10-35153	10-Apr-85	TL
	;	101 produces yet another obscure Ill mem ref.
	;
	;110	10-35161	14-May-85	TL
	;	101 didn't quite get blank line suppression right.  Deletion
	;	in /U mode isn't pretty.
	;
	;111	KBY		3-Jun-85	TL
	;	New HELPER needs more stack.  Increase it.
 REP 45/15	;11C6
		CAME	F1,F2		;HAVE WE LOOKED FROM THE MISMATCHED LINE
					;TO THE CURRENT LINE?
		AOJA	F1,MAIN12	;NO--UP LINE POINTER AND TRY AGAIN
		SETZ	F2,		;HAVEN'T FOUND A MATCH THIS TIME
					;NOW TRY IT THE OTHER WAY
	MAIN14:	CAML	F2,F1		;LOOKED FAR ENOUGH? (THIS VERSION HAS
 WIT
		MOVE	T,F2		;[107] TOP ON OTHER FILE
		CAMLE	T,TOP1		;[107] IS IT LONGER THAN TOP ON THIS FILE?
		 MOVE	T,TOP1		;[107] YES, USE TOP OF THIS FILE
		CAME	F1,T		;[107] HAVE WE LOOKED FROM THE MISMATCHED LINE
					;[107] TO THE CURRENT LINE?
		 AOJA	F1,MAIN12	;[107] NO--UP LINE POINTER AND TRY AGAIN
		SETZ	F2,		;[107] HAVEN'T FOUND A MATCH THIS TIME
					;[107] NOW TRY IT THE OTHER WAY
	MAIN14:	MOVE	T,F1		;[107] TOP ON OTHER FILE
		CAMLE	T,TOP2		;[107] IS IT LONGER THAN TOP ON THIS FILE
		 MOVE	T,TOP2		;[107] YES, USE TOP OF THIS FILE
		CAML	F2,T		;[107] LOOKED FAR ENOUGH? (THIS VERSION HAS
 REP 43/18	;11C7
	MULT66:	SUB	F1,W1		;[34] RESET TO 1ST COMPARISON
		SUB	F2,W1
 WIT
	MULT66:	EXCH	F1,TEMPF1	;[34] [110] RESET TO 1ST COMPARISION
		EXCH	F2,TEMPF2	;[110]
 REP 5/19	;11C8
		ADD	F1,NUMLIN	;CAUSE MOVEUP TO FLUSH ALL THE
		ADD	F2,NUMLIN	;  LINES THAT WERE JUST MATCHED
 WIT
		MOVE	F1,TEMPF1	;[110] CAUSE MOVEUP TO FLUSH ALL THE
		MOVE	F2,TEMPF2	;[110]   LINES THAT WERE JUST MATCHED
 REP 6/22	;11C9
		POPJ	PP,		;NO, RETURN
		SETOM	TEMP		;YES, INIT LINE COUNTER
	UPDAT1:	AOS	W1,TEMP		;GET NUMBER OF NEXT LINE
		CAMLE	W1,F2		;DONE?
		POPJ	PP,		;YES
		MOVEI	C,"|"		;[100] PRINT VERTICAL BAR IF
		SKIPN	DIFFLG		;  "DIFFERENCE FLAG" IS SET, OR IF
		SKIPE	F2		;  MORE THAN 1 LINE HAS BEEN LOOKED AT
		PUSHJ	PP,PCHAR
		SETZM	DIFFLG		;CLEAR "DIFFERENCE FLAG"
		MOVEI	C,.CHTAB	;[100] PRINT A TAB
		PUSHJ	PP,PCHAR
		PUSH	PP,F2		;SAVE F2
		MOVE	F2,W1		;GET LINE NUMBER TO PRINT
		PUSHJ	PP,SETONE	;GET BYTE POINTER TO LINE
 WIT
		 POPJ	PP,		;NO, RETURN
		JUMPL	F2,[HRLZS DIFFLG	;[110] YES, INSERTION ?
			    POPJ PP,]	;[110] YES, REMEMBER THAT
		SETOM	TEMP		;INIT LINE COUNTER
		SOS	F2		;[110] BACK UP A LINE
		PUSH	PP,F2		;[110] SAVE
	UPDAT1:	AOS	F2,TEMP		;[110] GET NUMBER OF NEXT LINE
		PUSHJ	PP,SETONE	;[110] NOW FETCH BYTE POINTER
		CAMLE	F2,(PP)		;[110] DONE?
		 JRST	UPDAT3		;[110] YES
		MOVEI	C,0		;[100] [110] PRINT VERTICAL BAR IF
		SKIPN	DIFFLG		;  "DIFFERENCE FLAG" IS SET, OR IF
		 JRST	UPDAT2		;  MORE THAN ONE LINE HAS BEEN LOOKED AT
		MOVEI	T,400K		;[110] UNLESS LINES ARE BLANK
		TDNE	T,(W2)		;[110] ...
		 JRST	UPDAT2		;[110] (THEY ARE)
		SETOM	DIFFLG		;[110] NOTE AT LEASE ONE VERTICAL BAR
		MOVEI	C,"|"		;[110]
	UPDAT2:	PUSHJ	PP,UPDAT5	;[110] PRINT DIFFERENCE CHAR AND LINE
		JRST	UPDAT1		;[110] CONTINUE

	UPDAT3:	MOVEI	C,0		;[110] DONE, DEFAULT TO NO CHANGE
		SKIPN	DIFFLG		;[110] IF NONE,
		 JRST	UPDAT4		;[110]  ASSUMPTION WON
		MOVEI	T,400K		;[110] SOME DIFFERENCE, BLANK LINE?
		TDNE	T,(W2)		;[110] IS IT?
		 JRST	[SKIPL	DIFFLG	;[110] YES, BLANK AND NO PREV "|"?
			  MOVEI C,"o"	;[110]        YES, DELETION
			 JRST	UPDAT4]	;[110] NO, BLANK + PREV "|", NO "|" HERE
		MOVE	T,DIFFLG	;[110] SEE WHAT KIND OF DIFFERENCE
		MOVEI	C,"o"		;[110] ASSUME DELETION
		 CAME	T,[-1]		;[110] IF END OF ORDINARY DIFFERENCE, "|"
		TLNN	T,-1		;[110] WAS IT A DELETION?
		 MOVEI	C,"|"		;[110] AN ORDINARY CHANGE.
	UPDAT4:	PUSHJ	PP,UPDAT5	;[110] PRINT THE LINE
		SETZM	DIFFLG		;[110] NO DIFFERENCES KNOWN NOW
		POP	PP,F2		;[110] RESTORE F2
		AOJA	F2,CPOPJ	;[110] RESUME SCAN

	UPDAT5:	PUSHJ	PP,PCHART	;[110] PRINT DIFFERENCE FLAG IF ANY
		MOVEI	C,.CHTAB	;[100] PRINT A TAB
		PUSHJ	PP,PCHAR
 REP 26/22	;11C10
		PUSHJ	PP,PCHAR	;AND PRINT IT
		POP	PP,F2		;RESTORE F2
		JRST	UPDAT1		;GO PRINT MORE LINES, IF ANY
 WIT
		JRST	PCHAR		;[110] PRINT IT AND RETURN
 SUM 107319