Trailing-Edge
-
PDP-10 Archives
-
bb-kl11f-bm_tops20_v7_0_atpch1_19
-
autopatch/getitm.c11
There are 2 other files named getitm.c11 in the archive. Click here to see a list.
REP 3/1 ;11C1
SUBTTL GET NEXT SOURCE WORD AL BLACKINGTON/CAM/SEB/DMN
WIT
SUBTTL GET NEXT SOURCE WORD AL BLACKINGTON/CAM/SEB/DMN/JEH
REP 38/10 ;11C2
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 27/13 ;11C3
MOVEM CT,TKNSIZ ;[1576]
AOS TKNSIZ ;[1576] ADD 2 FOR
AOS TKNSIZ ;[1576] OPEN AND CLOSE QUOTES
REP 3/24 ;11C4
ENDWRD: TLNE W1,GWLIT ;LITERAL?
WIT
ENDWRD: MOVEM CT,TKNSIZ## ;[1576] Store token size
TLNE W1,GWLIT ;LITERAL?
REP 43/39 ;11C5
JRST SKPSR4
WIT
;[1576] JRST SKPSR4
JRST SKPSR1 ;[1576] character has already been output
REP 28/43 ;11C6
CPLB20: CAIN TYPE,PIC. ;PICTURE IS SPECIAL
WIT
CPLB20: CAIE TYPE,PIC.+AMRGN. ;[1576]
CAIN TYPE,PIC. ;PICTURE IS SPECIAL
INS 38/47 ;11C7
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 39/51 ;11C8
SETZM TKNBH+1 ;[1576] Zero ptr so will store new one
INS 4/53 ;11C9
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 ;11C10
;[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]
IFE TOPS20,<
USETI LIB,(TE) ;[1576]
IN LIB, ;[1576]
SKIPA TE,LIBBH+1 ;[1576] OK
JRST GETLB9 ;[1576] ERROR
>
IFN TOPS20,<
SKIPE TE ;[1576]
SOS TE ;[1576] CONVERT TO WORD ADDRESS
LSH TE,7 ;[1576]
PUSHJ PP,SFPLIB## ;[1576] SET FILE POINTER
PUSHJ PP,GETLBA## ;[1576] FILL BUFFER
>
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 ;11C11
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
SUM 143396