Trailing-Edge
-
PDP-10 Archives
-
bb-l014q-bm_tops20_v6_1_atpch17
-
autopatch/update.mac
There are 10 other files named update.mac in the archive. Click here to see a list.
TITLE UPDATE MODULE FOR SOUPR
SUBTTL DEFINITONS
;HANLEY A. STRAPPMAN
SEARCH PRS,JOBDAT,UUOSYM
SALL
TWOSEG
EXTERN PROMPT,SPCI,COLON,SWTCH,EATEOL,CI,DECO,PUR,INDIR
EXTERN EATCR,WLDMAT,LKP,NTR,OCH,ICH
EXTERN SIXI,FNDNAM,DECI,EATS,PUTC,BP,SAVE1,LSTI
EXTERN LSNI,CPOPJ1,OCLS,ICLS,RST,SWINI
EXTERN WILDP,WILDER,SAVE3,WLDCNT,SPCO,CO,CRLFO
;DEFINE AC'S
F=0 ;FLAGS
;FLAGS
F.LOG==1 ;LOG FILENAMES
F.YN==2 ;1=INCLUDE
F.SUM==4 ;CHECKSUM COMMAND
F.UNC==10 ;1=UNCLUDE
F.BAS==40 ;BASE FILE IS WILD
;ASSEMBLY PARAMETERS
PDLSIZ==100 ;SIZE OF PDL
IFNDEF FLAGS,<FLAGS==F.LOG+F.UNC>;DEFAULT FLAGS
;CHANNEL USAGE
A==1 ;INPUT OF BASE FILE
B==2 ;INPUT OF COR FILE
O==3 ;OUTPUT FILE
DEFINE FTL(AA,BB),<
JRST [MOVEI T1,[TSEQO
VB ER.EAT,"?",AA,<BB at ^>]+1
JRST VERBO##]
>
SUBTTL EDIT HISTORY
VEDIT==1 ;COMPLETE VMAJOR=2 AUG 77
VEDIT==2 ;SUPPORT LINE SEQUENCE NUMBERS 9-17-77
VEDIT==3 ;ADD /UNCLUD/UXCLUD 9-17-77
VEDIT==4 ;FIX BUG CREATED BY /UNCLUD 10-10-77
VEDIT==5 ;ADD ERROR RETURN TO OCLS 10-15-77
VEDIT==6 ;CHANGE FROM WILD TO WILDER 10-15-77
VEDIT==7 ;IMPROVED ERROR MESSAGES 1-11-81
VEDIT==10 ;INDIRECT FILES 9-15-81
VEDIT==11 ;/BASE 12-3-82
VEDIT==12 ;SWITCH.INI 6-18-83
VWHO==0
VMAJOR==2
VMINOR==0
LOC .JBVER
BYTE (3)VWHO(9)VMAJOR(6)VMINOR(18)VEDIT
SUBTTL INITIALIZATION
RELOC 400000
UPDATE: JFCL ;NO CCL
MOVE P,[IOWD PDLSIZ,PDL] ;SETUP PDL
PUSHJ P,RST ;RESET
MOVEI F,FLAGS ;DEFAULT FLAGS
MOVE P2,[XWD -SWIL,SWN] ;READ SWITCH.INI
MOVEI P3,SWX
PUSHJ P,SWINI
JFCL
MOVEM F,SAVFLG ;SAVE DEFAULT FLAGS
COMMAN: PUSHJ P,RST ;RESET
SETZM ZER ;ZERO CORE
MOVE T1,[XWD ZER,ZER+1]
BLT T1,ZER+ZERSIZ-1
PUSHJ P,PARSE ;DO A COMMAND
JRST COMMAN
SUBTTL PARSE THE COMMAND LINE
PARSE: MOVE P2,[XWD -SWL,SWN] ;PROMPT USER
MOVEI P3,SWX
PUSHJ P,PROMPT
POPJ P,
PUSHJ P,INDIR ;DO INDIRECT FILE
MOVE T1,[XWD HGH,LOW] ;COPY NON-NULL DATA
BLT T1,LOW+LOWSIZ-1
MOVE F,SAVFLG ;DEFAULT FLAGS
MOVEI P1,OSPC ;GET O SPC
PUSHJ P,SPCI
POPJ P,
PUSHJ P,EATS ;EAT EQUAL
POPJ P,
CAIE C,"="
FATAL UPDSYN,<Syntax error>
PUSHJ P,CI
POPJ P,
MOVEI P1,ASPC ;GET A SPC
PUSHJ P,SPCI
POPJ P,
PUSHJ P,EATS ;EAT COMMA
POPJ P,
CAIE C,","
FATAL UPDSYN,<Syntax error>
PUSHJ P,CI
POPJ P,
MOVE T1,[XWD ASPC,BSPC] ;STICKY SPC
BLT T1,BSPC+SPCSIZ-1
HRLZI T1,'COR' ;BUT NEW DEFAULT EXT
MOVEM T1,BSPC+.SBEXT
MOVEI P1,BSPC ;GET B SPC
PUSHJ P,SPCI
POPJ P,
MOVE P2,[XWD -SWL,SWN] ;PARSE SWITCHES
MOVEI P3,SWX
PUSHJ P,SWTCH
POPJ P,
PUSHJ P,EATCR ;TEST FOR BREAK CHAR
POPJ P,
PUSHJ P,BP
FATAL UPDSYN,<Syntax error>
MOVEI P1,BSPC ;ASSUME B IS WILD
MOVEI P2,ASPC ;AND A IS NOT
TRNE F,F.BAS ;TRUE?
EXCH P1,P2 ;NOPE, SWITCH THEM
PUSHJ P,WILDP ;WILD?
EXCH P1,P2 ;NO, SWITCH AGAIN
MOVEI P2,MAIN ;WILDCARD LOOKUP
PUSHJ P,WILDER
JFCL
POPJ P,
SUBTTL MAINSTREAM
MAIN: PUSHJ P,SAVE3 ;SAVE P1-P3
AOS WLDCNT ;COUNT IT
MOVEI P2,ASPC ;MATCH WLD SPCS
MOVEI P3,ASPC2
PUSHJ P,WLDMAT
MOVEI P2,BSPC
MOVEI P3,BSPC2
PUSHJ P,WLDMAT
MOVEI P2,OSPC
MOVEI P3,OSPC2
PUSHJ P,WLDMAT
MOVE T1,ASPC2+.SBNAM ;OUTPUT DEFAULT TO INPUT
SKIPN OSPC2+.SBNAM
MOVEM T1,OSPC2+.SBNAM
PUSHJ P,LOG ;DO LOGGING
POPJ P,
MOVEI T1,A ;LOOKUP A FILE
MOVEM T1,ICH
MOVEI P1,ASPC2
PUSHJ P,LKP
POPJ P,
MOVEI T1,B ;LOOKUP B FILE
MOVEM T1,ICH
MOVEI P1,BSPC2
PUSHJ P,LKP
POPJ P,
MOVEI T1,O ;ENTER OUTPUT FILE
MOVEM T1,OCH
MOVEI P1,OSPC2
PUSHJ P,NTR
POPJ P,
MOVE T1,[XWD 1,1] ;PAGE 1 LINE 1
MOVEM T1,SEQ
SETZM CHKSUM ;RESET CHECK SUM
TRZ F,F.SUM ;NO CHECKSUM YET
PUSHJ P,LSNI ;GET 1ST CHAR
JRST EOFNG
LOOP: PUSHJ P,DOIT ;PROCESS ONE COMMAND
JRST EOFNG
TRNN F,F.SUM ;CHECKSUM COMMAND?
JRST LOOP ;NO
JRST CPOPJ1 ;YES
EOFNG: TRNN C,IO.EOF ;REAL ERROR OR JUST EOF?
POPJ P, ;ERROR
ERR ER.EAT,"?",UPDEOF,<Premature EOF>
;ROUTINE TO PROCESS A CORRECTION COMAAND
DOIT: PUSHJ P,EATS ;EAT SPACES
POPJ P,
CAIE C,";" ;COMMENT?
JRST DISP ;NO
PUSHJ P,EATEOL ;YES, EAT IT
POPJ P,
JRST LSNI ;GET 1ST CHAR
DISP: PUSHJ P,SIXI ;GET NAME OF CMD
POPJ P,
MOVE T2,[XWD -CMDL,CMDN] ;FIND IT IN TABLE
PUSHJ P,FNDNAM
POPJ P,
JRST @CMDX(T2) ;DISPATCH IT
;INSERT COMMAND
INS: PUSHJ P,SEQI ;GET STARTING LINE
POPJ P,
PUSHJ P,FIND ;FIND IT
POPJ P,
;FALL TO INSLP1
;ROUTINE TO DO AN INSERT
INSLP1: PUSHJ P,LSNI ;GET 1ST CHAR
POPJ P,
CAIN C," " ;NEW COMMAND?
JRST CPOPJ1 ;YES
CAIE C,11 ;PREFIX?
JRST INSNE ;NO
INSLP2: PUSHJ P,LSNI ;YES, GET NEXT CHAR
POPJ P,
INSNE: TRNN F,F.YN ;INCLUDE IT?
JRST .+3 ;NO
PUSHJ P,PUTC ;YES, OUTPUT IT
POPJ P,
PUSHJ P,BP ;A BREAK CHAR?
JRST INSLP2 ;NO, CONTINUE LINE
JRST INSLP1 ;YES, START NEW LINE
;REPLACE COMMAND
REP: PUSHJ P,SEQI ;GET STARTING LINE
POPJ P,
PUSHJ P,FIND ;FIND IT
POPJ P,
PUSHJ P,DELLP1 ;DO A DELETE
POPJ P,
PUSHJ P,EATEOL ;EAT A LINE
POPJ P,
JRST INSLP1 ;DO AN INSERT
;DELETE COMMAND
DEL: PUSHJ P,SEQI ;GET STARTING LINE
POPJ P,
PUSHJ P,FIND ;FIND IT
POPJ P,
;FALL TO DELLP1
;ROUTINE TO DO A DELETE
DELLP1: PUSHJ P,LSNI ;GET 1ST CHAR
POPJ P,
CAIN C," " ;A NEW COMMAND?
JRST CPOPJ1 ;YES
CAIE C,11 ;PREFIX?
JRST DELNE ;NO
DELLP2: PUSHJ P,LSNI ;YES, INPUT NEXT CHAR
POPJ P,
DELNE: MOVE P1,C ;SAVE IT
TRNN F,F.YN ;YES, INCLUDE THIS COMMAND?
JRST DELNO ;NO
MOVEI T1,A ;YES, ISELECT BASE FILE
MOVEM T1,ICH
PUSHJ P,AI ;INPUT A CHAR
POPJ P,
MOVEI T1,B ;ISELECT COR FILE
MOVEM T1,ICH
DELNO: CAME P1,C ;YES, THEN CHARS MUST MATCH
FTL UPDDEL,<Text to be deleted doesn't match base file>
PUSHJ P,BP ;A BREAK CHAR?
JRST DELLP2 ;NO, CONTINUE LINE
JRST DELLP1 ;YES, START NEW LINE
;CHECK SUM COMMAND
SUM: PUSHJ P,DECI ;GET CHECKSUM
POPJ P,
MOVE P1,T1
PUSHJ P,COMI ;EAT COMMENTS
POPJ P,
PUSHJ P,COPY ;COPY REST OF FILE
POPJ P,
HRRZ T1,CHKSUM ;COMPARE CHECK SUMS
ADDI T1,1
CAME P1,T1
FATAL UPDSUM,<Checksum error>
PUSHJ P,OCLS ;CLOSE FILES
JFCL
MOVEI T1,A
MOVEM T1,ICH
PUSHJ P,ICLS
MOVEI T1,B
MOVEM T1,ICH
PUSHJ P,ICLS
TRO F,F.SUM ;CHECKSUM DONE
JRST CPOPJ1
;ROUTINE TO COPY REST OF FILE
COPY: MOVEI T1,A ;ISELECT BASE FILE
MOVEM T1,ICH
COPYLP: PUSHJ P,AI ;GET A CHAR
JRST COPY0
PUSHJ P,PUTC
POPJ P,
JRST COPYLP
COPY0: TRNE C,IO.EOF ;REAL ERROR OR JUST EOF?
AOS (P) ;EOF, WIN
POPJ P, ;ERROR
;ROUTINE TO TYPE OUT LOG MESSAGE
LOG: TRNN F,F.LOG ;LOGGING?
JRST CPOPJ1 ;NO
SETOM OCH ;OSELECT TTY
PUSHJ P,CRLFO
POPJ P,
MOVEI P1,OSPC2 ;TYPE O SPEC
PUSHJ P,SPCO
POPJ P,
MOVEI C,"="
PUSHJ P,CO
POPJ P,
MOVEI P1,ASPC2 ;TYPE A SPEC
PUSHJ P,SPCO
POPJ P,
MOVEI C,","
PUSHJ P,CO
POPJ P,
MOVEI P1,BSPC2 ;TYPE B SPEC
JRST SPCO
;ROUTINE TO PARSE SEQUENCE NUMBERS
SEQI: PUSHJ P,DECI ;GET LINE NUMBER
POPJ P,
HRRZM T1,TSEQ
PUSHJ P,EATS ;EAT SLASH
POPJ P,
CAIE C,"/"
FATAL UPDSYN,<Syntax error in COR file>
PUSHJ P,LSNI
POPJ P,
PUSHJ P,DECI ;GET PAGE NUMBER
POPJ P,
HRLM T1,TSEQ
;FALL TO COMI
;ROUTINE TO EAT COMMENTS
COMI: TRZ F,F.YN ;ASSUME EXCLUDE
TRNE F,F.UNC ;UNCLUDE?
TRO F,F.YN ;OOPS, INCLUDE
PUSHJ P,EATCR ;EAT CR
POPJ P,
PUSHJ P,BP ;BREAK CHAR?
JRST .+2
JRST CPOPJ1 ;YES
CAIE C,";" ;NO, COMMENT?
FTL UPDSYN,<Syntax error in COR file>
PUSHJ P,LSNI ;YES, EAT THE SEMI
POPJ P,
PUSHJ P,SIXI ;GET NAME
POPJ P,
TRO F,F.YN ;ASSUME INCLUDE
SKIPN T2,NCLD ;INCLUDE SWITCH?
JRST NONCLD ;NO
NCLDLP: MOVE T3,1(T2) ;YES, GET AN ITEM
XOR T3,T1 ;MATCHES?
ANDCM T3,2(T2)
JUMPE T3,EATEOL ;YES, INCLUDE
HRRZ T2,(T2) ;ADVANCE TO NEXT ITEM
JUMPN T2,NCLDLP ;LOOP UNTIL NONE LEFT
TRZ F,F.YN ;NONE LEFT, EXCLUDE
NONCLD: SKIPN T2,XCLD ;EXCLUDE SWITCH?
JRST EATEOL ;NO
TRZ F,F.YN ;YES, ASSUME EXCLUDE
XCLDLP: MOVE T3,1(T2) ;GET AN ITEM
XOR T3,T1 ;MATCHES?
ANDCM T3,2(T2)
JUMPE T3,EATEOL ;YES, EXCLUDE
HRRZ T2,(T2) ;ADVANCE TO NEXT ITEM
JUMPN T2,XCLDLP ;LOOP UNTIL NONE LEFT
TRO F,F.YN ;NONE LEFT, INCLUDE
JRST EATEOL ;EAT THE REST OF THE LINE
;ROUTINE TO FIND A SEQUENCE NUMBER
FIND: TRNN F,F.YN ;INCLUDE THIS?
JRST CPOPJ1 ;NO
MOVEI T1,A ;ISELECT BASE FILE
MOVEM T1,ICH
FINDLP: MOVE T1,SEQ ;THERE YET?
CAMN T1,TSEQ
JRST FOUND ;YES
CAML T1,TSEQ ;NO, TOO FAR?
FTL UPDOOO,<Out of order>
PUSHJ P,AI ;NO, COPY A CHAR
POPJ P,
PUSHJ P,PUTC
POPJ P,
JRST FINDLP ;TRY AGAIN
FOUND: MOVEI T1,B ;ISELECT COR FILE
MOVEM T1,ICH
JRST CPOPJ1
;ROUTINE TO INPUT A CHAR FROM BASE FILE
;CALL WITH BASE FILE ALREADY SELECTED
AI: PUSHJ P,LSNI ;INPUT A CHAR
POPJ P,
MOVE T1,CHKSUM ;ADD IT TO CHECKSUM
ROT T1,1
ADDI T1,1(C)
MOVEM T1,CHKSUM
PUSHJ P,BP ;BREAK CHAR?
JRST CPOPJ1 ;NO
CAIE C,14 ;YES, FORM FEED?
JRST AI0 ;NO
HLRZ T1,SEQ ;YES, BUMP PAGE
ADDI T1,1
HRLZM T1,SEQ
AI0: AOS SEQ ;BUMP LINE
JRST CPOPJ1
SUBTTL ERROR MESSAGES
;ROUTINE TO TYPE THE TARGET SEQUENCE NUMBER
TSEQO: HRRZ T1,TSEQ
PUSHJ P,DECO
POPJ P,
MOVEI C,"/"
PUSHJ P,CO
POPJ P,
HLRZ T1,TSEQ
PJRST DECO
SUBTTL COMMANDS
DEFINE CMD,<
X DELETE,DEL
X INSERT,INS
X REPLAC,REP
X SUM,SUM
> ;END OF CMD
DEFINE X(A,B),<
SIXBIT /A/
>
CMDN: CMD
CMDL=.-CMDN
DEFINE X(A,B),<
B
>
CMDX: CMD
SUBTTL SWITCHES
;/INCLUDE SWITCH
INCLUD: PUSHJ P,SAVE1 ;SAVE P1
MOVEI T1,NCLD ;HE CHANGED HIS MIND, PURGE OLD CORE
PUSHJ P,PUR
PUSHJ P,COLON ;EAT COLON
JRST CPOPJ1
PUSHJ P,LSTI ;GET A SIXBIT LIST
JRST CPOPJ1
MOVEM P1,NCLD ;STORE ADR
POPJ P, ;WIN
;/EXCLUDE SWITCH
EXCLUD: PUSHJ P,SAVE1 ;SAVE P1
MOVEI T1,XCLD ;HE CHANGED HIS MIND, PURGE OLD CORE
PUSHJ P,PUR
PUSHJ P,COLON ;EAT COLON
JRST CPOPJ1
PUSHJ P,LSTI ;GET A SIXBIT LIST
JRST CPOPJ1
MOVEM P1,XCLD ;STORE ADR
POPJ P, ;WIN
DEFINE SW,<
X LOG,<TRO F,F.LOG>
X NOLOG,<TRZ F,F.LOG>
X UNCLUD,<TRO F,F.UNC>
X UXCLUD,<TRZ F,F.UNC>
X BASE,<TRO F,F.BAS>
X NOBASE,<TRZ F,F.BAS>
X COR,<TRZ F,F.BAS>
X NOCOR,<TRO F,F.BAS> ;;LAST SWITCH IN SWITCH.INI
X EXIT,<JRST EXT##>
X HELP,<PUSHJ P,HELPER##>
X XCLUDE,<PUSHJ P,EXCLUD>
X NCLUDE,<PUSHJ P,INCLUD>
>
DEFINE X(A,B),<
SIXBIT /A/
>
SWN: SW
SWL==.-SWN
SWIL==^D8 ;NUMBER OF SWITCHES IN SWITCH.INI
DEFINE X(A,B),<
B
>
SWX: SW
SUBTTL LOWSEG
LIT ;PUT LITERALS IN HIGHSEG
RELOC 0
PDL: BLOCK PDLSIZ ;PUSH DOWN LIST
BSPC: BLOCK SPCSIZ ;B SPC, WITH WILDCARDS
ASPC2: BLOCK SPCSIZ ;A SPC, WITHOUT WILDCARDS
BSPC2: BLOCK SPCSIZ ;B SPC, WITHOUT WILDCARDS
OSPC2: BLOCK SPCSIZ ;O SPC, WITHOUT WILDCARDS
TSEQ: BLOCK 1 ;TARGET SEQUENCE
CHKSUM: BLOCK 1 ;CHECK SUM
SEQ: BLOCK 1 ;SEQUENCE NUMBER
SAVFLG: BLOCK 1 ;SAVED FLAGS FROM SWITCH.INI
;BEGIN REGION TO BE ZEROED
ZER:!
XCLD: BLOCK 1 ;ADR OF EXCLUDE CHAIN
NCLD: BLOCK 1 ;ADR OF INCLUDE CHAIN
;END REGION TO BE ZEROED
ZERSIZ==.-ZER
LOW: ;NON-NULL DATA
RELOC ;BACK TO HIGHSEG
HGH: PHASE LOW
;BEGIN DO NOT SEPARATE
;O SPC, WITH WILDCARDS
OSPC: XWD SPCSIZ,0 ;SIZE OF BLK
SIXBIT /DSK/ ;DEVICE
0 ;DEVICE MASK
BLOCK SFDS+1 ;PPN&SFDS
IFN SFDS,<0>
BLOCK SFDS+1 ;PPN&SFDS MASKS
0 ;FILENAME
0 ;FILENAME MASK
SIXBIT /MAC/ ;EXTENSION
.IOASC ;ASCII MODE
;A SPC, WITH WILDCARDS
ASPC: XWD SPCSIZ,0 ;SIZE OF BLK
SIXBIT /DSK/ ;DEVICE
0 ;DEVICE MASK
BLOCK SFDS+1 ;PPN&SFDS
IFN SFDS,<0>
BLOCK SFDS+1 ;PPN&SFDS MASKS
0 ;FILENAME
0 ;FILENAME MASK
SIXBIT /MAC/ ;EXTENSION
.IOASC ;ASCII MODE
;END DO NOT SEPARATE
DEPHASE
LOWSIZ==.-HGH
RELOC LOW ;BACK TO LOWSEG
BLOCK LOWSIZ
END UPDATE