Trailing-Edge
-
PDP-10 Archives
-
bb-bt99e-bb
-
getitm.c05
There are 2 other files named getitm.c05 in the archive. Click here to see a list.
INS 4/2 ;05C1
;V12B***************
;DMN 10-Dec-82 [1445] 68274 removes period if last clause is turned into a comment.
;DMN 9-Dec-82 [1444] 68274 does not correctly convert /S format when comment column exists.
;DMN 7-Dec-82 [1440] COPY REPLACING loses terminal period if replacing a numeric literal.
;SMI 26-Oct-82 [1426] 68274 Make TALLY a COMP field.
;SMI 08-Oct-82 [1415] Generate statement before current line
; for 68274 converter.
;SMI 06-Oct-82 [1413] 68274 Does not handle DBMS correctly.
;SMI 17-SEP-82 [1406] COPY REPLACING doesn't work if continued in
; A margin.
;RLF 02-JUL-82 [1372] COPY REPLACING doesn't know == are
; missing after BY for pseudo-text.
;DMN 03-Jun-82 [1361] 68274 does not handle case of no CVT wanted.
;DMN 27-May-82 [1360] 68274 does not handle COPY REPLACING
; correctly.
;DMN 26-May-82 [1357] 68274 Converter gets wrong line buffer to
; use when replacing words.
;DMN 05-MAR-82 [1343] 68274 Converter does not convert NOTE into
; a comment
;RJD 23-Feb-82 [1342] Handle D in continuation column when
; scanning for end of literal
;JSM 1-Oct-81 [1316] Copy Repl gives spurious Fatal when Comment
; followed by Paragraph Name
;WTK 30-SEP-81 [1314] CONTIN. CHAR AFTER "(" GIVES BAD SUBSCRIPT
;PV/JM 24-SEP-81 [1310] Compiler forgets first of two LIB devices.
;DMN 13-JUL-81 [1304] 68274 Converter fails if very first word in a
; library has to be replaced by COBOL-74 syntax.
REP 46/3 ;05C2
CAIGE TE,^D12 ;IN A-MARGIN?
IORI CT,AMRGN. ;YES--SET FLAG
WIT
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
REP 19/10 ;05C3
PUSHJ PP,GETCH ;GET NEXT CHARACTER
TSWF FRTST ;[557] JUST DOING REPLACEMENT TEST?
WIT
GTWD1Z: PUSHJ PP,GETCH ;[1314] GET NEXT CHARACTER
CAIE CH,"-" ;[1314] MAKE SURE WE ARE NOT
JRST GTWD1Y ;[1314] LOOKING AT A
CAIN CP,7 ;[1314] CONTINUATION CHARACTER
JRST GTWD1Z ;[1314]
GTWD1Y: TSWF FRTST ;[557] JUST DOING REPLACEMENT TEST?
INS 8/28 ;05C4
IFN ANS74,< ;[1342] IS CONTINUATION COLUMN
CAIE CH,"D" ;[1342] A DEBUG LINE?
CAIN CH,"d" ;[1342]
SKIPA ;[1342]
JRST GETK2A ;[1342] NO--CHECK FOR HYPHEN
MOVEI CH," " ;[1342] REPLACE WITH A SPACE
JRST GETK6 ;[1342] RETURN
> ;[1342] END OF CHECK FOR DEBUG LINE
GETK2A: ;[1342]
REP 45/29 ;05C5
JRST FINLIN ;YES
WIT
;[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]
INS 17/30 ;05C6
;[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]
REP 17/33 ;05C7
GETSQ9: TSWF FNOCPY ;IGNORE IF NOT OUTPUTING TO CPYFIL
WIT
;[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
INS 25/33 ;05C8
;[1316] IF WE ARE FORCING SPACES TO LISTING, PUT IN TWO MORE TO TIDY IT UP.
TSWF FNCOFF ;[1316]
ADDI TD,2 ;[1316]
;[1316]
REP 29/33 ;05C9
PUSHJ PP,PUTCPY
WIT
;[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]
INS 30/35 ;05C10
TSWF FNOCPY ;[1360] ARE WE IN COPY REPLACING?
JRST GETSL0 ;[1360] YES, DON'T OUTPUT TWICE
INS 34/36 ;05C11
IFN FT68274,< ;[1413]
SETZM CVTPLF ;[1413] DISREGARD PREVIOUS LINE
> ;[1413]
REP 75/41 ;05C12
CPLB57: CAMN TA,DEVFIL(TC) ;SEE IF FILE NAME MATCH
CAME TB,DEVEXT(TC) ;AND EXTENSION
WIT
CPLB57: ;[M1310]
HLLZ TD,DEVEXT(TC) ;[1310] GET FILE EXTENSION BY ITSELF
SKIPN TD ;[1310] NULL EXTENSION?
MOVSI TD,'LIB' ;[1310] YES, ALLOW 'LIB' TO MATCH NULL
CAMN TA,DEVFIL(TC) ;SEE IF FILE NAME MATCH
CAME TB,TD ;[M1310] AND EXTENSION
REP 16/43 ;05C13
TLNE W1,GWRESV ;RESERVED WORD?
CAIE TYPE,EQUAL. ;YES, =
WIT
; TLNE W1,GWRESV ;[1406] RESERVED WORD?
CAIE TYPE,EQUAL. ;[1406] IS ITEM AN '=' ?
CAIN TYPE,EQUAL.+AMRGN. ;[1406] POSSIBLY IN A-MARGIN
SKIPA ;[1406] YES, CONTINUE
INS 22/43 ;05C14
CAIE TYPE,EQUAL.+AMRGN. ;[1406]
INS 31/43 ;05C15
CAIE TYPE,ENDIT. ;[1372] IS THIS THE END-OF-
CAIN TYPE,ENDIT.+AMRGN. ;[1372] FILE?
JRST CPB36A ;[1372] YES, SOMETHING IS WRONG.
REP 39/46 ;05C16
MOVEI DW,E.633 ;[1013] TELL USER ABOUT MISSING ==
WIT
CPB36A: MOVEI DW,E.633 ;[1372][1013] TELL USER ABOUT MISSING ==
INS 15/51 ;05C17
IFN FT68274,<
PUSHJ PP,BKPCVT ;[1360] DELETE LAST CHARACTER OUTPUT TO CVT FILE
>
INS 20/55 ;05C18
IFN FT68274,<
BKPCVT: TSWF FNOCPY ;[1360] DID WE WRITE TO CVT FIEL?
POPJ PP, ;[1360] NO
AOS CVTBFC ;[1360] COUNT LAST CHAR
MOVE TE,CVTBFP ;[1360]
ADD TE,[070000,,0] ;[1360]
SKIPGE TE ;[1360]
SUB TE,[430000,,1] ;[1360]
MOVEM TE,CVTBFP ;[1360]
POPJ PP, ;[1360]
>
REP 27/57 ;05C19
CAIA ;YES
WIT
TSWF FNOCPY ;[1360] YES, BUT IGMORE IF JUST DOING
;[1360] REPLACEMENT CHECK
REP 64/58 ;05C20
JRST GETLIB ;[M1125] [1064] Yes, go pick up a "." for real.
WIT
MOVEI CH,"." ;[1440] STORE PERIOD SO WE WILL STOP SCAN
MOVEM CH,TERSCN ;[1440] ON PERIOD IN CASE OF NUMERIC LITERAL
JRST GETLIB ;[M1125] [1064] Yes, go pick up a "." for real.
INS 105/58 ;05C21
IFN FT68274,<
PUSHJ PP,CVTCRL ;[1360] ADD CR-LF TO CURRENT LINE
PUSHJ PP,CVTOAL ;[1360] AND OUTPUT IT
>
INS 37/59 ;05C22
MOVE TD,[POINT 7,CVTLBF,6] ;[1304]
MOVEM TD,CVTSCP ;[1304] LDB POINTER TO START OF CURRENT LINE
MOVEM TD,CVTSNP ;[1304] RESET NEXT WORD POINTER ALSO
REP 5/66 ;05C23
INTERN CVTICL,CVTCCL,CVTDPL,CVTDCW,CVTSBP,CVTCTC,CVTUTC,CVTVTC,CVTRCW,CVTBCW,CVTACW,CVTICW,CVTTPL
WIT
INTERN CVTICL,CVTCCL,CVTDPL,CVTDCW,CVTSBP,CVTCTC,CVTUTC,CVTVTC,CVTRCW,CVTBCW,CVTACW,CVTICW,CVTTPL,CVTOAL,CVTINL ;[1413][1415]
REP 10/66 ;05C24
CVTOAL: SKIPE CVTPLB## ;ANYTHING IN LAST LINE BUFFER
WIT
CVTOAL: TSWF FNOCPY ;[1360] ARE WE IN COPY REPLACING?
POPJ PP, ;[1360] YES, DON'T OUTPUT TWICE
SKIPE CVTPLB## ;ANYTHING IN LAST LINE BUFFER
DEL 18/66 ;05C25
INS 23/66 ;05C26
AOS CVTBFL ;[1357] INCREMENT LINE NUMBER
INS 60/66 ;05C27
TSWF FSEQ ;[1444] /S?
SKIPA TD,[POINT 7,CVTWSS] ;[1444] YES
REP 63/66 ;05C28
CVTWSM: ASCIZ /01 TALLY PIC S9(5).
/
;HERE TO COPY TEXT POINTED TO BT TD INTO PREVIOUS LINE BUFFER
WIT
CVTWSM: ASCIZ /01 TALLY PIC S9(5) COMP.
/ ;[1426]
CVTWSS: ASCIZ /01 TALLY PIC S9(5) COMP. 68274
/ ;[1444]
;HERE TO COPY TEXT POINTED TO BY TD INTO PREVIOUS LINE BUFFER
REP 128/66 ;05C29
CVTDPL: SKIPN CVTPLF ;ANYTHING THERE?
WIT
CVTDPL: SKIPE FINVOK ;[1413] PART OF DBMS ?
POPJ PP, ;[1413] YES, EXIT
SKIPE BINDEV ;[1361] RETURN IF CVT FILE NOT WANTED
SKIPN CVTPLF ;ANYTHING THERE?
REP 138/66 ;05C30
JRST CVTDP3 ;NO
WIT
JRST CVTDP0 ;[1444] NO
INS 149/66 ;05C31
CVTDP0: TSWF FSEQ ;[1444] /S?
SKIPN CVTPXC ;[1444] YES, DID LINE GET LONGER?
JRST CVTDP3 ;[1444] NO, JUST COPY IT
PUSH PP,TC ;[1444] GET SOME FREE ACCS
PUSH PP,TB ;[1444]
PUSH PP,TA ;[1444]
SETZB TC,TB ;[1444] TC = QUOTE CHAR, TB = LAST SPACE BEFORE COL 73
SETZ TA, ;[1444] TA = COUNT OF REMOVABLE SPACES
MOVEI TE,1 ;[1444] TE = COL COUNT, STARTS AT 1
;[1444] Scan the line looking for a good place to split it.
;[1444] This is the last space before column 73 that is not in a quoted string.
;[1444] Also check to see if we can find enough consecutive spaces that can be
;[1444] removed so that the line does not need to be split.
CVTDPS: ILDB CH,TD ;[1444] GET NEXT CHAR
JUMPE CH,CVTDPF ;[1444] END OF INPUT
JUMPN TC,[CAIE CH,TC ;[1444] IN QUOTE, IS IT MATCHING?
SETZ TC, ;[1444] YES, CLEAR FLAG
AOJA TE,CVTDPS] ;[1444] GET NEXT
CVTDPQ: CAIE CH,"""" ;[1444] LOOK FOR A POSSIBLE QUOTE
CAIN CH,"'" ;[1444] OF EITHER KIND
JRST [MOVE TC,CH ;[1444] FOUND ONE
AOJA TE,CVTDPS] ;[1444] KEEP LOOKING
CAIL TE,^D12 ;[1444] DON'T COUNT SPACE TIL IN B FIELD
CAIE CH," " ;[1444] SPACE?
AOJA TE,CVTDPS ;[1444] NO, GET NEXT CHAR
CAIGE TE,^D73 ;[1444] ARE WE STILL IN FIELD B?
MOVE TB,TE ;[1444] YES, STORE COL # OF THIS SPACE
ADDI TE,1 ;[1444] ADVANCE TO NEXT COLUMN
CVTDPT: ILDB CH,TD ;[1444] NO, GET NEXT CHAR
JUMPE CH,CVTDPF ;[1444] END OF INPUT
CAIE CH," " ;[1444] IS IT A CONSECUTIVE SPACE?
JRST CVTDPQ ;[1444] NO, BACK TO MAIN LOOP
ADDI TA,1 ;[1444] COUNT ONE MORE
CAML TA,CVTPXC ;[1444] HAVE WE ENOUGH SPACES?
CAIL TE,^D73 ;[1444] WITHIN FIELD B?
AOJA TE,CVTDPT ;[1444] NOT YET, GET NEXT CHAR
CVTDPF: CAIL TE,^D73 ;[1444] ARE WE OUTSIDE FIELD B?
SUBI TA,6 ;[1444] YES, USER MIGHT HAVE COL 73-80 BLANK
MOVE TD,[POINT 7,CVTPLB] ;[1444] RESET INPUT POINTER
JUMPE TB,CVTDPZ ;[1444] NEVER FOUND A SPACE
CAML TA,CVTPXC ;[1444] DID WE FIND ENOUGH CONSECUTIVE SPACES?
JRST CVTDPB ;[1444] YES, JUST REMOVE THEM
MOVE TE,TB ;[1444] NO, MUST SPLIT LINE
ILDB CH,TD ;[1444]
PUSHJ PP,CVTDCH ;[1444] DUMP CHARACTER
SOJG TE,.-2 ;[1444] LOOP FOR FIRST LINE
MOVEI TE,^D72 ;[1444] FILL LINE WITH SPACES
SUB TE,TB ;[1444] JUST TO BE NEAT
MOVEI CH," " ;[1444] GET SPACE
SKIPLE TE ;[1444] IN CASE LINE IS ALREADY FULL
PUSHJ PP,CVTDCH ;[1444] DUMP CHARACTER
SOJG TE,.-1 ;[1444] LOOP FOR FIRST LINE
MOVE TE,[POINT 7,[ASCIZ / 68274
/]] ;[1444] NEW COMMENT
CVTDPG: ILDB CH,TE ;[1444]
JUMPE CH,CVTDPH ;[1444] COPY UNTIL TERMINAL NULL IS FOUND
PUSHJ PP,CVTDCH ;[1444] DUMP CHARACTER
JRST CVTDPG ;[1444] LOOP
CVTDPH: MOVE TE,TB ;[1444] NO. OF SPACES TO OUTPUT
SUB TE,CVTPXC ;[1444] LESS EXTRA CHARACTERS WE HAVE
JUMPLE TE,CVTDPZ ;[1444] NONE
MOVEI CH," " ;[1444] GET SPACE
PUSHJ PP,CVTDCH ;[1444] DUMP CHARACTER
SOJG TE,.-1 ;[1444] LOOP FOR FIRST LINE
CVTDPZ: POP PP,TA ;[1444] RESTORE THE ACCS
POP PP,TB ;[1444]
POP PP,TC ;[1444]
JRST CVTDP3 ;[1444] COPY REST OF LINE
;[1444] Here to remove enough consecutive spaces so that line now fits
CVTDPB: MOVE TA,CVTPXC ;[1444] LOAD COUNT OF SPACES TO REPLACE
SETZ TC, ;[1444] CLEAR QUOTE FLAG
MOVEI TE,^D12 ;[1444] DON'T REMOVE SPACES UNTIL B MARGIN
CVTDPC: ILDB CH,TD ;[1444] GET NEXT CHAR
SUBI TE,1 ;[1444] COUNT DOWN UNTIL B MARGIN
CVTDPD: PUSHJ PP,CVTDCH ;[1444] OUTPUT IT
JUMPN TC,[CAIE CH,TC ;[1444] IN QUOTE, IS IT MATCHING?
SETZ TC, ;[1444] YES, CLEAR FLAG
JRST CVTDPC] ;[1444] GET NEXT
CAIE CH,"""" ;[1444] LOOK FOR A POSSIBLE QUOTE
CAIN CH,"'" ;[1444] OF EITHER KIND
JRST [MOVE TC,CH ;[1444] FOUND ONE
JRST CVTDPC] ;[1444] KEEP LOOKING
JUMPG TE,CVTDPC ;[1444] JUMP IF NOT IN B FIELD
CAIE CH," " ;[1444] SPACE?
JRST CVTDPC ;[1444] NO, GET NEXT CHAR
CVTDPE: ILDB CH,TD ;[1444] GET NEXT CHAR
CAIE CH," " ;[1444] IS IT A CONSECUTIVE SPACE?
JRST CVTDPD ;[1444] NO, BACK TO MAIN LOOP
SOJG TA,CVTDPE ;[1444] YES, REMOVE IT
JRST CVTDPZ ;[1444] ALL DONE WITH SPACES
INS 216/66 ;05C32
INS 231/66 ;05C33
MOVE TE,CVTSCL ;[1357] AND SAME FOR LINE NUMBER
MOVEM TE,CVTBFL ;[1357]
MOVEM TE,CVTSNL ;[1357]
REP 239/66 ;05C34
POPJ PP,
WIT
PUSH PP,CVTSNL## ;[1357] AND SAME FOR LINE NUMBER
POP PP,CVTSCL## ;[1357]
PUSH PP,CVTBFL## ;[1357]
POP PP,CVTSNL ;[1357]
POPJ PP,
;[1415] Here to insert a line before the current line
CVTINL: HRLI TB,(POINT 7,) ;[1415] CREATE BYTE POINTER
AOS CVTSCL ;[1415] INCREMENT CURRENT LINE
PUSHJ PP,CVTCCW ;[1415] CHECK WHAT LINE CURRENT WORD IS ON
JRST CVTIN4 ;[1415] ON PREVIOUS LINE
PUSHJ PP,CVTDPL ;[1415] DEPOSITE PREVIOUS LINE
;[1415] Copy current line to previous line without distroying current line
MOVE TD,[CVTLBF,,CVTPLB] ;[1415]
BLT TD,CVTPLB+CVTLBZ-1 ;[1415]
;[1415] Find first character in previous line buffer
CVTIN1: PUSH PP,CH ;[1415]
MOVE TD,[POINT 7,CVTPLB] ;[1415] CREATE BYTE POINTER TO CVTPLB
CVTIN2: ILDB CH,TD ;[1415] GET CHARACTER FROM PREVIOUS BUFFER
CAIN CH," " ;[1415] SPACE ?
JRST CVTIN2 ;[1415] YES
CAIG CH,"9" ;[1415] PART OF LINE NUMBER ?
CAIGE CH,"0" ;[1415]
SKIPA ;[1415] NO
JRST CVTIN2 ;[1415] YES, SKIP PAST LINE NUMBERS
CAIN CH,$HT ;[1415] TAB ?
JRST CVTIN2 ;[1415] YES
;[1415] Replace the remaining characters of the previous line buffer with
;[1415] the string pointed to by TB. Also add in CRLF to end of line
;[1415] TD = ADDRESS OF STRING TO BE REPLACED
;[1415] TB = ADDRESS OF STRING TO REPLACE IT
ILDB CH,TB ;[1415] GET FIRST CHARACTER
DPB CH,TD ;[1415] STORE IT
CVTIN3: ILDB CH,TB ;[1415] GET NEXT CHARACTER
IDPB CH,TD ;[1415] STORE IT
SKIPE CH ;[1415] FINISHED ?
JRST CVTIN3 ;[1415] NO
MOVEI CH,$CR ;[1415] WRITE CR-LF TO PREVIOUS LINE
DPB CH,TD ;[1415]
MOVEI CH,$LF ;[1415]
IDPB CH,TD ;[1415]
SETZM CH ;[1415] WRITE OUT NULL
IDPB CH,TD ;[1415]
POP PP,CH ;[1415]
SOS CVTSCL ;[1415] RESET CURRENT LINE
POPJ PP, ;[1415]
;[1415] Current word is in the previous buffer,
CVTIN4: MOVE TD,[CVTPLB,,CVTTMP##] ;[1415]
BLT TD,CVTTMP+CVTLBZ-1 ;[1415]
PUSHJ PP,CVTIN1 ;[1415] REPLACE PREVIOUS LINE
PUSHJ PP,CVTDPL ;[1415] DUMP IT
MOVE TD,[CVTTMP,,CVTPLB] ;[1415]
BLT TD,CVTPLB+CVTLBZ-1 ;[1415]
POPJ PP, ;[1415]
REP 53/68 ;05C35
CVTCCW: HRRZ TC,CVTSCP ;FIRST CHECK TO SEE IF WORD IS IN
HRRZ TD,CVTBFP ; CURRENT LINE OR PREVIOUS
CAMLE TC,TD ; WHICH CAN HAPPEN IF DELIMITER IS ON NEXT LINE
POPJ PP, ;ITS IN PREVIOUS LINE
CAME TC,TD ;JUST INCASE THEY ARE EQUAL (A VERY SMALL WORD?)
JRST CPOPJ1 ;NO, DEFINITELY IN CURRENT BUFFER
HLRZ TC,CVTSCP ;I DOUBT IF THIS TEST IS NECESSARY
HLRZ TD,CVTBFP
CAML TC,TD ;BYTE POINTERS DECREASE
AOS (PP)
WIT
CVTCCW: MOVE TC,CVTSCL ;[1357] GET LINE NUMBER OF CURRENT WORD
CAML TC,CVTBFL ;[1357] IS IT IN CURRENT LINE?
AOS (PP) ;[1357] YES
REP 20/69 ;05C36
IBP TA ;ACCOUNT FOR FIRST CHARACTER WE READ
WIT
TSWT FSEQ ;[1444] /S?
JRST CVTRW9 ;[1444] NO, WE HAVE FOUND IT
;[1444] We can not be sure that we are synchronised yet. We might be in the comment field.
;[1444] A simple count will not work as the user might have tabs in the source line.
;[1444] We will compare the next 6 characters or until either runs out.
PUSH PP,TA ;[1444] SAVE THE POINTERS
PUSH PP,TB ;[1444]
PUSH PP,TC ;[1444]
PUSH PP,CH ;[1444] HOLDS COUNT
MOVEI CH,6 ;[1444] OF CHARACTERS TO COMPARE FOR MATCH
IBP TA ;[1444] ACCOUNT FOR FIRST CHAR
CVTRW7: ILDB TD,TA ;[1444] GET NEXT
JUMPE TD,CVTRW8 ;[1444] MUST HAVE MATCH
ILDB TE,TC ;[1444] GET NEXT FROM SOURCE LINE
CAIE TE,(TD) ;[1444] MATCH?
CAIN TE,"a"-"A"(TD) ;[1444] OR LOWER CASE?
TRNA ;[1444] OK UP TO THIS POINT
JRST CVTRWF ;[1444] NOT A MATCH
SOJG CH,CVTRW7 ;[1444] TRY NEXT
CVTRW8: POP PP,CH ;[1444] RESTORE
POP PP,TC ;[1444]
POP PP,TB ;[1444]
POP PP,TA ;[1444]
CVTRW9: IBP TA ;[1444] ACCOUNT FOR FIRST CHARACTER WE READ
REP 48/69 ;05C37
SKIPE TC
SUBI TD,1 ;BACK UP TO NO. OF FULL WORDS
JUMPE TC,CVTRC6 ;JUMP IF NO REMAINDER
WIT
SUBI TD,1 ;BACK UP TO NO. OF FULL WORDS
SKIPN TE,TC ;[1445] GET REMAINDER TO CORRECT ACC
JRST CVTRC6 ;[1445] JUMP IF NO REMAINDER
REP 62/69 ;05C38
CVTRW6: MOVE TE,[POINT 7,CVTLBF,6]
MOVEM TE,CVTSCP ;LDB POINTER TO START OF CURRENT LINE
WIT
CVTRWF: POP PP,CH ;[1444] RESTORE
POP PP,TC ;[1444]
POP PP,TB ;[1444]
POP PP,TA ;[1444]
CVTRW6: MOVE TE,[POINT 7,CVTLBF,6]
MOVEM TE,CVTSCP ;LDB POINTER TO START OF CURRENT LINE
AOS CVTSCL ;[1357] INCREMENT LINE NUMBER ALSO
INS 29/70 ;05C39
LDB TE,CVTSCP ;[1343] CHECK THAT LAST BYTE IS NOT A PERIOD
CAIN TE,"." ;[1343] BECAUSE IF IT IS THEN IT BELONGS TO
IBP CVTSCP ;[1343] THE PREVIOUS FIELD, SO BYPASS IT.
REP 70/70 ;05C40
MOVEI TE,$CR ;REMOVE THE CURRENT WORD FROM PREV BUFFER
WIT
CVTEPM: MOVEI TE,$CR ;[1445] REMOVE THE CURRENT WORD FROM PREV BUFFER
INS 1/72 ;05C41
;[1445] Same as CV1. except that we backup to in front of current word.
;[1445] We must be very careful about periods and not turn them into comments.
INS 7/72 ;05C42
MOVE TE,CVTSCL ;[1445] LINE NUMBER OF START OF CURRENT WORD
CAMGE TE,CVTBFL ;[1445] IS IT IN CURRENT BUFFER?
AOJA TE,CVTVT3 ;[1445] NO, TRY PREVIOUS
INS 36/72 ;05C43
;[1445] Scan previous line looking for first delimiter.
;[1445] If its a period then we have to split the line.
;[1445] If its a space, comma ,semi-colon continue until a non-space or <cr-lf> or period is found.
;[1445] If we get to <cr-lf> turn all of line into comment.
;[1445] This will not guard against /S format KEY-WORD .COL73 where the period is in column 73.
CVTVT3: CAME TE,CVTBFL ;[1445] IN PREVIOUS BUFFER?
JRST CVTSCP ;[1445] NO, JUST GIVE UP
MOVE TD,CVTSCP ;[1445] GET POINTER TO CURRENT WORD
SUBI TD,CVTLBF-CVTPLB ;[1445] IN PREVIOUS BUFFER
CVTVT4: ILDB TE,TD ;[1445] GET NEXT CHAR
JUMPE TE,CVTUT3 ;[1445] END OF LINE
CAIE TE,$CR ;[1445]
CAIN TE,$LF ;[1445]
JRST CVTUT3 ;[1445] END OF LINE FOUND
CAIN TE,"." ;[1445] PERIOD?
JRST CVTVT6 ;[1445] YES, SPLIT LINE
CAIE TE," " ;[1445] LOOK FOR DELIMITERS
CAIN TE," " ;[1445]
JRST CVTVT5 ;[1445] SPACE OR TAB
CAIE TE,"," ;[1445]
CAIN TE,";" ;[1445]
JRST CVTVT5 ;[1445]
JRST CVTVT4 ;[1445] TRY NEXT CHAR
CVTVT5: ILDB TE,TD ;[1445] NOW LOOK FOR COBOL WORD OR E-O-L
JUMPE TE,CVTUT3 ;[1445] END OF LINE
CAIE TE,$CR ;[1445]
CAIN TE,$LF ;[1445]
JRST CVTUT3 ;[1445] END OF LINE FOUND
CAIN TE,"." ;[1445] PERIOD?
JRST CVTVT6 ;[1445] YES, SPLIT LINE
CAIE TE," " ;[1445] LOOK FOR DELIMITERS
CAIN TE," " ;[1445]
JRST CVTVT5 ;[1445] SPACE OR TAB
CAIE TE,"," ;[1445]
CAIN TE,";" ;[1445]
JRST CVTVT5 ;[1445]
JRST CVTUT3 ;[1445] FOUND SOMETHING, COULD BE COMMENT FIELD
CVTVT6: HRRZ TE,TD ;[1445] GET ADDRESS
PUSH PP,(TE) ;[1445] SAVE THE TWO WORDS
PUSH PP,1(TE) ;[1445] SO WE CAN ADD <CR-LF> SAFELY
PUSH PP,TD ;[1445] AND ADDRESS
PUSHJ PP,CVTEPM ;[1445] ADD <cr-lf-null>
PUSHJ PP,CVTDPL ;[1445] DUMP FIRST PART OF LINE
POP PP,TD ;[1445] RESTORE BYTE POINTER
HRRZ TE,TD ;[1445]
POP PP,1(TE) ;[1445] RESTORE TWO WORDS
POP PP,(TE) ;[1445]
PUSH PP,CVTSCP ;[1445]
MOVEM TD,CVTSCP ;[1445] FAKE OUT CV0. CODE
MOVE TD,[POINT 7,CVTPLB] ;[1445] POINT TO START OF PREVIOUS BUFFER
MOVE TE,CVTPLB ;[1445] SEE IF SOS LINE NUMBER
TRNN TE,1 ;[1445]
JRST CVTVT7 ;[1445] ITS NOT
PUSHJ PP,ASCIAD ;[1445] GENERATE NEW LINE NO.
MOVEM TE,CVTPLB ;[1445] STORE IT
MOVE TD,[POINT 7,CVTPLB+1,6] ;[1445]
CVTVT7: PUSHJ PP,CVTCT3 ;[1445] SO IT WILL REPACE FIRST PART WITH SPACES
MOVEI TE,"." ;[1445]
DPB TE,TD ;[1445] RESTORE PERIOD
POP PP,CVTSCP ;[1445] RESTORE
SETZM CVTCPF ;[1445] MAKE SURE PERIOD IS NOT A COMMENT
JRST CVTUT3 ;[1445] AND FOR NEXT LINE ALSO
INS 20/76 ;05C44
EXTERN AMARFL ;[1316] IF -1 FORCE A-MARGIN AFTER LF FOLLOWING
;[1316] * COMMENT
SUM 194568