Trailing-Edge
-
PDP-10 Archives
-
bb-l014r-bm_tops20_v6_1_atpch_18
-
autopatch/scnmac.mac
There are 35 other files named scnmac.mac in the archive. Click here to see a list.
SUBTTL COMMAND SCANNER MACROS %7D(304) 24-MAR-87
IFDEF %.C,<IFE %.C,<XLIST>>
IFNDEF %.C,<XLIST>
CUSTVR==0 ;CUSTOMER VERSION
DECVER==7 ;DEC VERSION
DECMVR==4 ;DEC MINOR VERSION
DECEVR==304 ;DEC EDIT VERSION
;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1971,1974,1981,1984,1985,1986,1987. ALL RIGHTS RESERVED.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY
;TRANSFERRED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE
;AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;DEFINE %.C NON-ZERO TO LIST FILE
;DEFINE %.C==-1 TO ASSEMBLE SCNMAC IN BOTH PASSES
;DEFINE %.C==-2 TO ALSO INCLUDE END STATEMENT, I.E., NORMAL LISTING
;DEFINE %.C==-3 TO MAKE SCNMAC A UNIVERSAL FILE
;DETERMINE IF SPECIAL ASSEMBLY NEEDED
IF1,<%..C==1 ;ALWAYS ASSEMBLE PASS1
IFDEF %.C,< IFE %.C+2,<TITLE SCNMAC -- LISTING OF SCNMAC.MAC (SCAN PARAMETER FILE)>
IFE %.C+3,<UNIVERSAL SCNMAC -- SCAN PARAMETER UNIVERSAL SYMBOL TABLE
%..C==-77>>
>;END OF IF1
IF2,<IFNDEF %.C,<%.C==0
IFDEF %%SCAN,<%.C==-1>> ;SUPPLY VALUE IF USER DIDN'T
%..C==%.C ;USE USER'S VALUE FOR PASS2
>;END OF IF2
LIST
IFE %..C,<TAPE> ;SKIP REST IF NO ASSEMBLY NEEDED ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IFN %..C+77,< ;DON'T ASSEMBLE UNIVERSAL PASS1
%%SCNM==<BYTE (3)CUSTVR(9)DECVER(6)DECMVR(18)DECEVR>
PURGE CUSTVR,DECVER,DECMVR,DECEVR
;MACRO DEFINITIONS OF GENERAL USE
;DEFAULTS
;DM ABBREVIATION,MAX,ADEFAULT,PDEFAULT
; DEFINES SYMBOLS MX.ABBREVIATION,AD.ABBREVIATION, AND PD.ABBREVIATION
; TO BE THE MAXIMUM ALLOWED VALUE, THE DEFAULT IF THE KEYWORD
; IS ABSENT, AND THE DEFAULT IF THE KEYWORD IS PRESENT RESPECTIVELY
; UNLESS THE CORRESPONDING SYMBOL IS ALREADY DEFINED.
DEFINE DM(ABBR,MAX,ADEF,PDEF),<
ND MX.'ABBR,MAX
ND AD.'ABBR,ADEF
ND PD.'ABBR,PDEF>
;REVISION HISTORY OF PARAMETER FILE
;%2(47) MAY, 1972, WITH SCAN 2(127)
;50 ADD SYMBOLS FOR ALL WORDS AND LENGTHS IN SCAN BLOCK
; ADD FX.DFX, FX.TRM, AND .FXTRA,O,N,C.
; OBSOLETE FX.ADD.
;51 ADD FX.NDV.
;52 MAKE USEABLE AS A UNIVERSAL FILE
;%3(52) DEC, 1972 WITH SCAN 3(173)
;53 ADD COMMENTS TO .FX DEFINITIONS TO INDICATE WHEN SET
;54 ADD DEFENSIVE PRINTX TO SWTCHS MACROS
;55 ADD FLAGS CONCEPT TO SWITCH TABLES; ADD FS.NFS
;56 AD FS.LRG TO HANDLE VALUES .GT. 2**17
;57 ADD FS.MOT DEFINITION FOR .TSCAN FLAGS
;60 ADD FLAGS FOR .TDIRB CALL
;61 ADD FLAG FS.NUE
;62 CLEAN UP LISTING OF PAGE 1
;63 ALLOW * IN KEYS LISTS
;64 ADD FX.PRT
;65 ADD FS.VRQ
;66 DELETE FX.ADD
;67 TEST BAD ARGS ONLY IN PASS2
;70 IMPROVE ON 67 SLIGHTLY
;%4(70) DEC, 73 WITH SCAN 4(275)
;71 DEFINE FS.OBV
;72 DEFINE JWW.??
;73 DEFINE FS.MIO
;74 CORRECT OVERPROTECTION OF DEFAULT TO 377777,,777777
;75 ADD SN STYLE SWITCHES
;76 ADD SCAN WORDS 24-31 AND FX.SUP
;77 ADD OVERRIDE ON POINT ARGUMENT TO SWITCH MACROS
;%5(77) JUN, 74 WITH SCAN 5(363)
;100 DEFINE FS.ICL
;%6(100) JULY, 1974 WITH SCAN 6
;101 ADD GUIDE WORDS AS .CHXXX: AND, OR, NOT
;102 CLARIFY FS.NFS; ADD FS.NCM
;103 ADD GUIDE WORDS 4002-4011
;104 REMOVE ASK MACRO (NEVER IMPLEMENTED)
;105 EXPAND (AND MOVE) FX.DEN FOR 5.07/6.02
;106 ADD FS.IFI TO SIGNIFY INDIRECT FILE ILLEGAL IN FILE SPEC
;300 PY 18-Aug-81
; Change version number to 7D to match SCAN. Change the
; edit number to 300 to avoid confusion with the version
; of SCNMAC produced by TOPS-20 RUNOFF.
;7D(300) JAN, 82 WITH SCAN 7D(630)
;
;301 DPM 30-Dec-84
; Add WSM's /HELP:ARGUEMENTS.
;302 DPM 4-Jan-85
; Add new .ISCAN bit FS.INC to indicate calling program doesn't
; want SCAN to do CORE UUOs.
;303 LEO 23-AUG-85
; Do Copyrights.
;304 RCB 24-Mar-87
; Teach KEYS macro to handle hyphenated keywords in the list. Only define
; indexing symbols for non-null list elements which allow us to form valid
; MACRO-10 symbol names.
;WORDS IN FILE SPEC AREA
.FXDEV==0 ;DEVICE (NON-ZERO IF ANY PART OF SPEC)
.FXNAM==1 ;NAME (NON-ZERO IF NAME PRESENT)
.FXNMM==2 ;NAME MASK
.FXEXT==3 ;EXTENSION,,EXTENSION MASK (NON-ZERO DOT PRESENT)
.FXMOD==4 ;MODIFIER WORD
.FXMOM==5 ;MODIFIER MASK
.FXDIR==6 ;DIRECTORY WORD (EACH HALF=0 IF DEFAULT; SFD:0 IF END)
.FXDIM==7 ;DIRECTORY MASK
.FXBFR==22 ;/BEFORE
.FXSNC==23 ;/SINCE
.FXABF==24 ;/ABEFORE
.FXASN==25 ;/ASINCE
.FXFLI==26 ;FILE MIN SIZE (WORDS)
.FXFLM==27 ;FILE MAX SIZE (WORDS)
.FXEST==30 ;/ESTIMATE
.FXVER==31 ;/VERSION
;LENGTHS OF FILE SPEC AREA
.FXLEN==32 ;LENGTH OF ONE SPECIFICATION
.FXLND==6 ;LENGTH OF DIRECTORY (UFD+SFD'S)
;BYTES IN SCAN MOD WORD
FX.NDV==1B0 ;NULL DEVICE
FX.NUL==1B1 ;NULL EXTENSION
FX.DIR==1B2 ;DIRECTORY SPECIFIED (MOD=0 IF [-])
FX.PHY==1B3 ;/PHYSICAL
FX.NOM==1B4 ;/OKNONE
FX.DFX==1B5 ;DIRECTORY DOES NOT NEED FIX-UP BY WILD
FX.TRM==7B8 ;CODE FOR SPEC'S TERMINATION
.FXTRA==1 ;& (AND)
.FXTRO==2 ;! (OR)
.FXTRN==3 ;- (NOT)
.FXTRC==4 ;+ (CONCATENATE)
FX.STR==1B9 ;/STRS
FX.PRT==1B10 ;/OKPROT
FX.SUP==1B11 ;/ERSUPERSEDE
FX.DEN==7B23 ;/DENSITY [105]
FX.PAR==1B24 ;/PARITY
FX.PRO==777B35 ;/PROTECTION
;SPECIAL CHARACTERS FOR SCAN
.CHALX==0 ;ALTMODE
.CHEOL==-1 ;END OF LINE
.CHEOF==-2 ;END OF FILE
;GUIDE WORDS (TURNED INTO PSEUDO CHARACTERS)
.CHAND==4000 ;'AND' [101]
.CHOR==04001 ;'OR' [101]
.CHNOT==4002 ;'NOT' [101]
.CHTO==04003 ;'TO' [103]
.CHFRM==4004 ;'FROM' [103]
.CHINP==4005 ;'INPUT' [103]
.CHOUT==4006 ;'OUTPUT' [103]
.CHSRC==4007 ;'SOURCE' [103]
.CHLST==4010 ;'LIST' [103]
.CHOBJ==4011 ;'OBJECT' [103]
;FLAGS FOR .ISCAN CALL
FS.ICL==1B17 ;IGNORE SPECIAL COMMAND-LINE HANDLING
FS.IFI==1B16 ;INDIRECT FILE ILLEGAL IN COMMAND [106]
FS.INC==1B15 ;DON'T DO CORE UUOS
;FLAGS FOR .TSCAN CALL
FS.MOT==1B18 ;MULTIPLE OUTPUT SPECS POSSIBLE
FS.MIO==1B19 ;MIXED INPUT AND OUTPUT SPECS
;FLAGS FOR .TDIRB CALL
TS.DRW==0 ;SINGLE WORD
TS.DRP==1 ;PATH POINTER
TS.DRB==2 ;BIWORD (IE, SCAN SPEC FORMAT)
;VALUES FROM .VERBO
JWW.CN==1B33 ;/VERBOS:CONTINUATION
JWW.FL==1B34 ;/VERBOS:FIRST
JWW.PR==1B35 ;/VERBOS:PREFIX
;SWITCH SCANNING MACROS AND TABLES
;SWTCHS IS THE MACRO LISTING ALL KNOWN SWITCHES
;IT INCLUDES THE NAME AND STORAGE LOCATION
;FOR VALUE TYPES, IT ALSO HAS THE MAX AND DEFAULT AND PROCESSOR
;FOR KEY-VALUE TYPES, IT POINTS TO THE KEYS AND HAS THE DEFAULT IF ANY
;FOR STAND-ALONE TYPES, IT HAS THE VALUE.
;WHEN THE SWITCH SCANNING TABLES ARE TO BE BUILT, INVOKE
;THE MACRO DOSCAN WITH 5-CHAR ARGUMENT TO USE AS SYMBOL PREFIX
;IT WILL DEFINE XXXXXN,L,P,M,D
; SL NAME,STORAGE,TABLE-NAME,DEFAULT,FLAGS
; DEFINES A LIST OF KEY-VALUES (SEE KEYS MACRO)
; DEFAULT IS THE ORDINAL OR 0 IF NO DEFAULT
; IF LH(STORAGE)=7777B11, STORAGE = ROUTINE TO PROCESS
;
; SP NAME,STORAGE,PROCESSOR,ABBREVIATION,FLAGS
; DEFINES A VALUE PARAMETER WHOSE DEFAULTS
; ARE DEFINED AT THE BEGINNING OF THE PROGRAM
; BY "DM" USING THE SAME ABBREVIATION
; PROCESSOR IS THE JUMP ADDRESS IN SWITCH PROCESSING
; IT WILL BE CALLED WITH P1=SWITCH OFFSET IN TABLE
; AND P2=POINTER TO 4-WORD BLOCK OF INTERNAL OR EXTERNAL STUFF
; IF MAX=0 AND FS.LRG, THEN ANY VALUE CAN BE STORED
; ELSE, 0.LE.VALUE.LE.MAX
;
; 0.LE.MAX,DEFAULT.LT.2**17 UNLESS FS.LRG
;
; IF MAX=0 AND NOT FS.LRG, THEN PROCESSOR IS AN IMMEDIATE ACTION
; WHICH WILL ALWAYS BE CALLED
; ELSE, PROCESSOR WILL BE CALLED ONLY IF ":"
;
; SS NAME,STORAGE,VALUE,FLAGS
; DEFINES A STAND-ALONE PARAMETER
;
; IN ALL CASES, STORAGE IS A BYTE POINTER.
; IF A FULL WORD, ONLY THE ADDRESS IS NEEDED
; IF A MULTIPLE WORD, THE BYTE SIZE IS 65-#WORDS (UP TO 28)
; IF A FILE SPECIFICATION, THE LENGTH IS HELD IN MX.ABBREVIATION
; IF POINTER IS 7777??,,?????? THEN RH(POINTER) IS DISPATCH
; ADDRESS OF PROCESSOR WHICH TAKES KEYWORD SWITCH VALUES
;
; SN NAME,STORAGE,FLAGS
; DEFINES A STAND-ALONE PARAMETER WHICH TAKES VALUE
; 1 IF /NAME, AND VALUE 0 IF /NONAME
; KEYS (NAME,LIST) WILL DEFINE A LIST OF KEYS BY NAME NAME
; NAME CAN BE UP TO 4 CHARS. (DEFINES NAME.T AND NAME.L)
; LIST IS SIXBIT NAMES SEPARATED BY COMMAS.
; DEFINES NAME CONCATENATED WITH START OF ITEM IN LIST
; AS INDEX IN LIST UNLESS THE ITEM BEGINS WITH "*"
DEFINE SL($NAME,$RESULT,$TABLE,$DEFAULT,$FLAGS),<
X $NAME,$TABLE'.T-1,<$RESULT>,$DEFAULT,-$TABLE'.L,$FLAGS
>
DEFINE SP($NAME,$RESULT,$PROCESSOR,$ABBR,$FLAGS),<
X $NAME,$PROCESSOR,<$RESULT>,PD.'$ABBR,MX.'$ABBR,$FLAGS
>
DEFINE SS($NAME,$RESULT,$VALUE,$FLAGS),<
X $NAME,0,<$RESULT>,$VALUE,0,$FLAGS
>
DEFINE SN($NAME,$RESULT,$FLAGS),<
X $NAME,0,<$RESULT>,0,0,FS.NOS!$FLAGS
>
;FLAGS WHICH CAN BE DEFINED IN SWITCH TABLE
FS.NFS==1B0 ;THIS SWITCH IS NEVER PART OF A FILE SPECIFICATION
; THIS SHOULD BE SET ON GLOBAL SWITCHES
; ** VERY IMPORTANT TO GET RIGHT **
FS.LRG==1B1 ;THE MAX AND DEFAULT VALUES ARE 0 OR .GT. 2**17
FS.NUE==1B2 ;NO USER EXIT ON THIS SWITCH
FS.VRQ==1B3 ;VALUE REQUIRED
FS.OBV==1B4 ;OR BIT VALUES TO RIGHT HALF
FS.NOS==1B5 ;SWITCH TAKES "NO" PREFIX (INTERNAL FOR SN MACRO ONLY)
FS.NCM==1B6 ;SWITCH DOES NOT CONSTITUTE A COMMAND [102]
; (FOR /RUN, /OPTION, /EXIT)
FS.HEL==1B7 ;ADDRESS OF SWITCH PROCESSOR -1 CONTAINS EITHER:
; 1. 0,,ADDRESS OF AN ASCIZ HELP STRING
; 2. AN INSTRUCTION TO GENERATE HELP TEXT
; (USUALLY A PUSHJ P,FOO WHICH GETS XCT'ED)
;DON'T USE FS.R??, WHICH ARE DEFINED IN C.MAC
;MACRO TO BUILD THE TABLES FROM THE SWTCHS MACRO
DEFINE DOSCAN(PFX),<
XALL
;;TABLE OF SIXBIT SWITCH NAMES
DEFINE X($NAME,$PROC,$POINT,$DEFLT,$MAX,$FLAGS),<
EXP SIXBIT /$NAME/
>
PFX'N: SWTCHS
PFX'L==.-PFX'N
;;TABLE OF BYTE POINTERS TO STORE RESULT
IF2,<
DEFINE X($NAME,$PROC,$POINT,$DEFLT,$MAX,$FLAGS),<
..TEMP==0
IRP $POINT,<
IFE ..TEMP-1,<
$POINT ;$NAME
>
IFE ..TEMP-2,<
POINT 36,$POINT,35 ;$NAME
>
IFIDN <$POINT><*P>,<..TEMP==1> ;;PARTIAL WORD
IFIDN <$POINT><*F>,<..TEMP==2> ;;FULL WORD
>
IFB <$POINT>,<
Z ;$NAME
..TEMP==1>
IFE ..TEMP,<
IFN <$POINT>_-^D24,<
..TEMP==$POINT
..TEMP ;$NAME
>
IFE ..TEMP,<
POINT 36,$POINT,35 ;$NAME
>
>>>
PFX'P: SWTCHS
;;TABLE OF IF LT 0, IOWD KEY TABLE
;; OR IF GE 0, XWD MAX,PROCESSOR
MX.==0
DEFINE X($NAME,$PROC,$POINT,$DEFLT,$MAX,$FLAGS),<
IF2,<
IFE <$FLAGS>&FS.LRG,<IFG <$MAX>-377777,<PRINTX ?MAXIMUM OF /$NAME CANNOT BE GT 377777>>
>
..TEMP==1
IFN <$FLAGS>&FS.LRG,<IFN <$MAX>,<..TEMP==0>>
IFN ..TEMP,<
XWD $MAX,$PROC ;$NAME
>
IFE ..TEMP,<
XWD [$MAX],$PROC ;$NAME
>
>
PFX'M: SWTCHS
;;FLAGS,,DEFAULT VALUE
PD.==0
DEFINE X($NAME,$PROC,$POINT,$DEFLT,$MAX,$FLAGS),<
IF2,<
IFL <$DEFLT>,<IFN <$DEFLT>+1,<PRINTX ?DEFAULT OF /$NAME CANNOT BE NEGATIVE>>
IFE <$FLAGS>&FS.LRG,<IFG <$DEFLT>-777777,<PRINTX ?DEFAULT OF /$NAME CANNOT BE GT 777777>>
>
IFB <$FLAGS>,<..TEMR==0>
IFNB <$FLAGS>,<..TEMR==($FLAGS)>
..TEMP==1
IFN <$FLAGS>&FS.LRG,<IFN <$DEFLT>,<..TEMP==0>>
IFN ..TEMP,<
XWD ..TEMR,$DEFLT ;$NAME
>
IFE ..TEMP,<
XWD ..TEMR,[$DEFLT] ;$NAME
>
>
PFX'D: SWTCHS
PURGE ..TEMP,..TEMR
SALL
>
;AND FINALLY, THE KEY-WORD VALUES
DEFINE KEYS(NAME,LST),<
NAME'.L==0
NAME'.T: IRP (LST)<EXP SIXBIT /LST/
NAME'.L==NAME'.L+1
..TEMP==0
IRPC (LST)<IFE <"LST"-"*">*<"LST"-"-">,<..TEMP==1
STOPI>>
IFNB<LST>,<IFE ..TEMP,<NAME'LST==NAME'.L>>
>
PURGE ..TEMP
>
;M.FAIL <FOO> SENDS FOO AS A FATAL ERROR
DEFINE M.FAIL (A),<
EXT .FMSG
PJSP T1,.FMSG
XLIST
ASCIZ \A\
LIST
>
;M.FAIN <FOO> SENDS FOO AS A FATAL ERROR WITH N IN SIXBIT
DEFINE M.FAIN (A),<
EXT .FMSGN
PJSP T1,.FMSGN
XLIST
ASCIZ \A\
LIST
>
;M.FAID <FOO> SENDS FOO AS A FATAL ERROR WITH N IN DECIMAL
DEFINE M.FAID (A) <
EXT .FMSGD
PJSP T1,.FMSGD
XLIST
ASCIZ \A\
LIST
>
;M.FAIO <FOO> SENDS FOO AS A FATAL ERROR WITH N IN OCTAL
DEFINE M.FAIO (A),<
EXT .FMSGO
PJSP T1,.FMSGO
XLIST
ASCIZ \A\
LIST
>
;M.MAIF <FOO> SENDS FOO AS A FATAL ERROR WITH N=ADDR OF FILE DESCRIPTOR
DEFINE M.FAIF(A)<
EXT .FMSGF
PJSP T1,.FMSGF
XLIST
ASCIZ \A\
LIST
>
>;END OF %..C+77 ON PAGE 1
IF1,< ASUPPRESS>
IFDEF %.C,<IFLE %.C+2,<
IF2,<PURGE %.C,%..C>
END>> ;BIND OFF TO GET CLEAN LISTING