Google
 

Trailing-Edge - PDP-10 Archives - bb-y390o-bm_tops20_v41_atpch_20 - autopatch/getitm.c13
There are 10 other files named getitm.c13 in the archive. Click here to see a list.
 REP 46/3	;13C1
		SKIPN	AMARFL		;[1316] FLAG ON FOR COPY REPL "LF" KLUDGE?
					;[1316] TELL SQURL. USER-NAME IS IN A-MARGIN
		CAIGE	TE,^D12		;IN A-MARGIN?
		IORI	CT,AMRGN.	;YES--SET FLAG
		SETZM	AMARFL		;[1316] TURN OFF FLAG FOR COPY REPL "LF" KLUDGE
 WIT
	;[1576] Delete 1L plus a second line of comment
		CAIGE	TE,^D12		;IN A-MARGIN?
		IORI	CT,AMRGN.	;YES--SET FLAG
	;[1576] Delete 1L - removing edit 1316
 REP 51/10	;13C2
		SETZB	CT,LC		;CLEAR COUNTERS
 WIT
		TSWT	FRTST		;[1576] ARE WE READING FOR REPLACEMENT TEST?
		JRST	GTW1CC		;[1576] NO
		DMOVE	W1,LIBBH+1	;[1576] STORE LIB FILE BUFFER HDR
		DMOVEM	W1,ENDTKN##+1	;[1576]  AT THE POINT WHERE THE TOKEN STARTS,
		MOVE	CT,RPLBLK	;[1576]  NOT AT WHERE THE SCAN FOR THE TOKEN
		MOVEM	CT,ENDTKN	;[1576]  STARTS, COULD BE POINTING TO COMMENT
		SKIPE	TKNBH+1		;[1576] HAS THE FIRST TOKEN IN REPLACEMENT
		JRST	GTW1CC		;[1576]  STRING BEEN STORED?

	GTW1CD: MOVEM	CT,TKNBH##	;[1576] NO
		DMOVEM	W1,TKNBH+1	;[1576]
		
	GTW1CC:	SETZB	CT,LC		;[1576] CLEAR COUNTERS
 INS 36/13	;13C3
		MOVEM	CT,TKNSIZ	;[1576]
		AOS	TKNSIZ		;[1576] Add 2 for
		AOS	TKNSIZ		;[1576]  open and close quotes
 REP 3/24	;13C4
	ENDWRD:	TLNE	W1,GWLIT	;LITERAL?
 WIT
	ENDWRD:	MOVEM	CT,TKNSIZ##	;[1576] Store token size
		TLNE	W1,GWLIT	;LITERAL?
 REP 45/29	;13C5
	;[D1316]	JRST	FINLIN		;YES
	;[1316] AT THIS POINT, WE HAVE THE LF AND WE HAVE TO DECIDE WHETHER TO
	;[1316] TO PUT IT ON THE LISTING. IT GOES ON LISTING IF THE FOLLOWING
	;[1316] FIVE SWITCHES HAVE THE APPROPRIATE SETTINGS: FCOPY - OFF,
	;[1316] FRLIB - ON, FNOCPY - ON, FRTST - ON, NOCONT - ON. (CONTINUATIONS
	;[1316] ARE FORTUITOUSLY DISALLOWED FOR * COMMENT LINES.)
	;[1316] OTHERWISE FINLIN WILL BE ALLOWED TO BEHAVE AS BEFORE.
	;[1316]
		JRST	[SKIPN	NOCONT		;[1316] CONTIN'S DISALLOWED?
			 JRST	FINLIN		;[1316] NO
			 TSWF	FRLIB		;[1316] READING LIB FILE?
			 TSWF	FCOPY		;[1316] COPY REPL IN PROGRESS?
			 JRST	FINLIN		;[1316]
			 TSWF	FRTST		;[1316] TESTING FOR REPL MATCH?
			 TSWT	FNOCPY		;[1316] NOT PUTTING LF TO LISTING?
			 JRST	FINLIN		;[1316]
			 SWOFF	FNOCPY		;[1316] FORCE IT TO LISTING
			 SWON	FNCOFF		;[1316] NOTE THAT WE FORCED IT
			 JRST	FINLIN]		;[1316] GO FORCE IT
						;[1316]
 WIT
		JRST	FINLIN		;[1576] YES

	;[1576] Delete 11L and all associated comments
 REP 17/30	;13C6
	;[1316] IF WE FORCED THE LF TO THE LISTING, WE HAVE TO RESET FNOCPY SO
	;[1316] THAT IT WON'T CAUSE PROBLEMS BEFORE WE GET TO GETSQ9
	;[1316]
		TSWFZ	FNCOFF		;[1316] DID WE FORCE LF TO LISTING?
		SWON	FNOCPY		;[1316] YES, ALSO RESET FNOCPY
					;[1316]
 WIT
	;[1576] Delete 2L and associated comments
 REP 17/33	;13C7
	;[1316] HERE WE HAVE TO DO THE SAME RAIN DANCE AS AT GETCH5 ABOVE. THIS
	;[1316] TIME THE OBJECTIVE IS TO GET THE SIX SPACES IN FRONT OF THE NEW
	;[1316] LINE ONTO THE LISTING. ALSO, NOT SURPRISINGLY, WE HAVE TO HOLD
	;[1316] OFF ON PUTTING THE FIRST CHARACTER OF THE USER NAME TO THE LISTING
	;[1316] IN SITUATIONS WHERE THE FIVE CONDITIONS ARE MET.
	;[1316]
	;[D1316] GETSQ9:	TSWF	FNOCPY	;IGNORE IF NOT OUTPUTING TO CPYFIL
	;[1316]
	GETSQ9:				;[M1316]
		SKIPN	NOCONT		;[1316] CONTIN'S DISALLOWED?
		JRST	GTSQ9A		;[1316] NO
		TSWF	FRLIB		;[1316] READING LIB FILE?
		TSWF	FCOPY		;[1316] COPY REPL IN PROGRESS?
		JRST	GTSQ9A		;[1316]
		TSWF	FRTST		;[1316] TESTING FOR REPL MATCH?
		TSWT	FNOCPY		;[1316] NOT PUTTING SPACES TO LISTING?
		JRST	GTSQ9A		;[1316]
		SWOFF	FNOCPY		;[1316] FORCE THEM TO LISTING
		SWON	FNCOFF		;[1316] NOTE THAT WE FORCED THEM
	GTSQ9A:				;[1316]
		TSWF	FNOCPY		;[M1316] IGNORE IF NOT PUTTING OUT TO CPYFIL
		JRST	GETSQ2

 WIT

	;[1576] Delete 12L and associated comments

	GETSQ9:	TSWF	FNOCPY		;[1576] Ignore if not outputting to CPYFIL
		JRST	GETSQ2
 REP 44/33	;13C8
	;[1316] IF WE ARE FORCING SPACES TO LISTING, PUT IN TWO MORE TO TIDY IT UP.
		TSWF	FNCOFF		;[1316]
		ADDI	TD,2		;[1316]
					;[1316]
 WIT
	;[1576] Delete 2L and associated comments
 REP 52/33	;13C9
	;[1316] IF WE ARE FORCING SPACES TO LISTING, SUPPRESS FIRST CHARACTER OF
	;[1316] USER NAME FOR NOW. IT WILL GET ONTO LISTING LATER.
		TSWT	FNCOFF		;[1316]
					;[1316]
		PUSHJ	PP,PUTCPY
	;[1316] NOW WE SET SWITCH TO INDICATE USER NAME IS IN A-MARGIN, AND THEN
	;[1316] RESTORE FNOCPY AND FNCOFF SWITCHES.
		TSWF	FNCOFF		;[1316] ARE WE FORCING SPACES TO LISTING?
		SETOM	AMARFL		;[1316] SET A-MARGIN FLAG FOR KLUDGE
		TSWFZ	FNCOFF		;[1316] CLEAR THIS FLAG, IF SET
		SWON	FNOCPY		;[1316] AND RE-SET THIS ONE, IF NECESSARY
					;[1316]
 WIT
	;[1576] Delete 1L and associated comments
		PUSHJ	PP,PUTCPY
	;[1576] Delete 4L and associated comments
 REP 43/39	;13C10
		JRST	SKPSR4
 WIT
	;[1576]	JRST	SKPSR4
		JRST	SKPSR1		;[1576] character has already been output
 REP 31/43	;13C11
	CPLB20:	CAIN	TYPE,PIC.	;PICTURE IS SPECIAL
 WIT
	CPLB20:	CAIE	TYPE,PIC.+AMRGN. ;[1576]
		CAIN	TYPE,PIC.	;PICTURE IS SPECIAL
 INS 38/47	;13C12
		SETO	TB,		;[1576] MAY HAVE BEEN A COUPLE OF TERMINATING
		ADJBP	TB,SRCBH+1	;[1576]  CHARACTERS SINCE SCAN DOESN'T
		LDB	TB,TB		;[1576]  STOP ON A LINE FEED, SO BACK UP
		CAIN	TB,$LF		;[1576]  THE POINTER AND LOOK
		AOS	SRCBH+2		;[1576]
 INS 42/51	;13C13
		SETZM	TKNBH+1		;[1576] Zero ptr so will store new one
 INS 4/53	;13C14
		PUSH	PP,W1		;[1576] NO AC'S ANYWHERE
		MOVE	W1,RPLBH+1	;[1576] WHERE SCAN FOR REPLACEABLE TOKEN STARTS
		CAME	W1,TKNBH+1	;[1576] WHERE TOKEN WAS FOUND
		MOVE	W1,L1CPO	;[1576] GET THE OUTPUT CHAR POSIT BEFORE LOOK-
		MOVEM	W1,SAVECP	;[1576]  AHEAD STARTED TO RESTORE ACTIVE VALUE
		PUSHJ	PP,WRTCMT	;[1576] WRITE OUT THE DIFFERENCE, PROB. COMMENT

		MOVE	W1,TKNSIZ	;[1576] SIZE OF LAST TOKEN SCANNED
		HLRZ	CH,TE		;[1576] GET COPY OF W1, LOOK AT FLAGS
		CAIE	CH,GWRESV.+PRIOD.	;[1576] WAS LAST MATCH FOR A PERIOD?
		SOS	W1		;[1576] SUBTRACT 1 SINCE BPTR WILL BE ADVANCED
		MOVE	CH,W1		;[1576]
		ADJBP	W1,ENDTKN+1	;[1576] POINT AT END OF LAST REPLACED TOKEN
		CAMLE	CH,ENDTKN+2	;[1576] ALL IN SAME BUFFER?
		JRST	[SUB	CH,ENDTKN+2	;[1576] NO - ADJUST BUFFER HEADER
			 AOS	ENDTKN+0	;[1576] ADVANCE BLOCK NUMBER
			 MOVNS	CH		;[1576] RESET COUNT OF UNPROCESSED
			 ADDI	CH,1200		;[1576]  CHARACTERS
			 MOVEM	CH,ENDTKN+2	;[1576]
			 SUBI	W1,200		;[1576] BACK UP BYTE POINTER
			 JRST	.+1]		;[1576]
		CAMN	W1,LIBBH+1	;[1576] IF MATCHES, NO TRAILING COMMENT, ETC.
		SETZ	W1,		;[1576]  SO ZERO THE BYTE POINTER
		MOVEM	W1,ENDTKN+1	;[1576] STORE IN BUFFER HEADER
		POP	PP,W1		;[1576] 

 INS 1/57	;13C15
	;[1576] Write out comment preceding/following replaced token to cpyfil
	WRTCMT:				;[1576]
		PUSH	PP,TE		;[1576] GET SOME AC'S
		PUSH	PP,W1		;[1576]
		PUSH	PP,W2		;[1576]
		MOVE	TE,RPLBH+0	;[1576] GET THE BLOCK NBR WHERE TEXT STARTED
		CAMN	TE,RPLBLK	;[1576] DOES IT MATCH THE CURRENT NBR?
		JRST	WTCMT2		;[1576] YES
	WTCMT1:	MOVE	TE,RPLBH	;[1576] PUT IT IN TE
		PUSHJ	PP,WTSTBF	;[1576] BACK UP THE LIBRARY FILE
		AOS	RPLBH+0		;[1576] 
	WTCMT2: SOSG	RPLBH+2		;[1576] DECREMENT AVAILABLE CHARACTER COUNT
		 JRST	WTCMT1		;[1576]  NO MORE, GET ANOTHER BUFFER FULL
		IBP	RPLBH+1		;[1576] ADVANCE THE BYTE POINTER
		MOVE	CH,RPLBH+1	;[1576] HAVE WE PROCESSED ALL THE CHARACTERS
		CAMN	CH,TKNBH+1	;[1576]  UP TO THE TOKEN TO BE REPLACED?
		JRST	WTCMT4		;[1576] YES
		MOVE	CH,@RPLBH+1	;[1576] NO, LOOK AT THE CONTENTS OF THE WORD
		TRNN	CH,1		;[1576] IS IT A LINE NUMBER WORD?
		JRST	WTCMT3		;[1576] NO, LIBRARY  TEXT
		JUMPL	CH,WTCMT4	;[1576] END OF PROGRAM?
		MOVNI	CH,5		;[1576] NO--JUMP OVER 5 CHARACTERS
		ADDB	CH,RPLBH+2	;[1576]
		JUMPLE	CH,WTCMT1	;[1576] JUMP IF BUFFER NOW EMPTY
		AOS	RPLBH+1		;[1576] IT ISN'T--BUMP BYTE POINTER
		MOVEI	CH,40		;[1576] PUT OUT SIX BLANKS
		MOVNI	TE,6		;[1576]
		PUSHJ	PP,PUTCPY	;[1576]
		AOJN	TE,.-1		;[1576]
		MOVE	CH,RPLBH+1	;[1576] HAS THE BYTE POINTER NOW BEEN ADVANCED
		CAMN	CH,TKNBH+1	;[1576]  TO THE TOKEN TO BE REPLACED?
		JRST	WTCMT4		;[1576] YES
		
	WTCMT3:	LDB	CH,RPLBH+1	;[1576] LOAD A LIBRARY TEXT CHARACTER
		JUMPE	CH,WTCMT2	;[1576] 
		AOS	L1CPI		;[1576] ADVANCE INPUT CHAR START POSITION
		PUSHJ	PP,PUTCIF	;[1576] WRITE OUT THE CHAR. TO CPYFIL
		JRST	WTCMT2		;[1576]

	WTCMT4:	MOVE	TE,SAVECP	;[1576] PUT THE NEW OUTPUT CHAR POSITION
		MOVEM	TE,L1CPO	;[1576]  IN COPY REPLACING PLACE HOLDER
		MOVE	TE,RPLBLK	;[1576] IF LIBBH+1 POINTS TO A DIFFERENT
		CAME	TE,TKNBH+0	;[1576]  BUFFER, RELOAD IT NOW
		PUSHJ	PP,WTSTBF	;[1576]
		POP	PP,W2		;[1576] RESTORE AC'S
		POP	PP,W1		;[1576]
		POP	PP,TE		;[1576]
		POPJ	PP,		;[1576]

	WTSTBF:	PUSH	PP,LIBBH	;[1576] SAVE CURRENT LIB FILE BUFFER HEADER
		PUSH	PP,LIBBH+1	;[1576]
		PUSH	PP,LIBBH+2	;[1576]

		USETI	LIB,(TE)	;[1576]
		IN	LIB,		;[1576]
		  SKIPA	TE,LIBBH+1	;[1576] OK
		JRST	GETLB9		;[1576] ERROR

		DMOVE	W1,LIBBH+1	;[1576] PUT THE ACTIVE BUFFER HEADER
		SKIPG	RPLBH+2		;[1576]  INTO THE REPLACEMENT BUFFER HEADER
		DMOVEM	W1,RPLBH+1	;[1576]
		POP	PP,LIBBH+2	;[1576] RESTORE THE LIB FILE'S ACTUAL HEADER
		POP	PP,LIBBH+1	;[1576]
		POP	PP,LIBBH	;[1576]
		POPJ	PP,		;[1576]
 REP 33/58	;13C16
	GETCP4:	SWOFF	FCOPY		;TURN OFF REPLACING REQUIRED
 WIT
	;[1576] Have now finished replacing token. If there is a trailing comment,
	;[1576] copy it now.
	GETCP4:				;[1576]
		MOVE	CH,ENDTKN+1	;[1576] POINTER TO END OF REPLACED TOKENS
		JUMPE	CH,GTCP4B	;[1576] CONTINUE
		CAMN	CH,LIBBH+1	;[1576]  IF NO TRAILING DATA
		JRST	GTCP4B		;[1576]
		HRLZI	CH,ENDTKN	;[1576] COPY TRAILING BUFFER HEADER
		HRRI	CH,RPLBH	;[1576]  INTO REPLACEMENT BUFFER HEADER
		BLT	CH,RPLBH+2	;[1576]
		MOVEI	CH,1		;[1576] BACK UP LIB FILE POINTER BY ONE
		ADJBP	CH,LIBBH+1	;[1576]  AND STORE IN TKNBH+1 TO MARK
		MOVEM	CH,TKNBH+1	;[1576]  WHERE TO STOP COPY
		PUSHJ	PP,WRTCMT	;[1576] WRITE OUT TRAILING DATA
		MOVE	CH,INPTCP	;[1576] REPLACE INPUT CHAR POSITION AFTER COPY
		MOVEM	CH,L2CPI	;[1576]  WITH NEW ACTUAL COUNT FOR PADDING CALC

	GTCP4B:	SWOFF	FCOPY		;[1576] TURN OFF REPLACING REQUIRED
 REP 20/78	;13C17
	EXTERN	AMARFL		;[1316] IF -1 FORCE A-MARGIN AFTER LF FOLLOWING
				;[1316]  * COMMENT
 WIT
	;[1576] Delete unnecessary symbol AMARFL
 SUM 41983