Trailing-Edge
-
PDP-10 Archives
-
ap-c796e-sb
-
scc3.mac
There is 1 other file named scc3.mac in the archive. Click here to see a list.
SUBTTL COMMAND SCANNER MACROS %3(52) 22-OCT-72
IFNDEF %.C,<XLIST>
CUSTVR==0 ;CUSTOMER VERSION
DECVER==3 ;DEC VERSION
DECMVR==0 ;DEC MINOR VERSION
DECEVR==52 ;DEC EDIT VERSION
;***COPYRIGHT 1971,1972 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***
;DEFINE %.C TO LIST FILE
;DEFINE %.C==-1 TO ASSEMBLE SCNMAC IN BOTH PASSES
;DEFINE %.C==-2 TO ALSO INCLUDE END STATEMENT
;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
PASS2>>>
IF2,<IFNDEF %.C,<%.C==0
IFDEF %%SCAN,<%.C==-1>> ;SUPPLY VALUE IF USER DIDN'T
%..C==%.C ;USE USER'S VALUE FOR PASS2>
LIST
SALL ;CLEAN EXPANSION LISTINGS
IFE %..C,<TAPE> ;SKIP REST IF NO ASSEMBLY NEEDED
;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>
%%SCNM==<BYTE (3)CUSTVR(9)DECVER(6)DECMVR(18)DECEVR>
PURGE CUSTVR,DECVER,DECMVR,DECEVR
;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
;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
; DEFINES A LIST OF KEY-VALUES (SEE KEYS MACRO)
; DEFAULT IS THE ORDINAL OR 0 IF NO DEFAULT
; IF LH(STORAGE)=0, STORAGE = ROUTINE TO PROCESS
;
; SP NAME,STORAGE,PROCESSOR,ABBREVIATION
; DEFINES A VALUE PARAMETER WHOSE DEFAULTS
; ARE DEFINED AT THE BEGINNING OF THE PROGRAM BY "DM"
; PROCESSOR IS THE JUMP ADDRESS IN SWITCH PROCESSING
;
; SS NAME,STORAGE,VALUE
; 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 8)
;
; IF MAX=0, THEN ANY VALUE CAN BE STORED
; ELSE, 0.LE.VALUE.LE.MAX
;
; 0.LE.MAX,DEFAULT.LT.2**17
; 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
DEFINE SL(NAME,RESULT,TABLE,DEFAULT),<
X NAME,TABLE'.T-1,<RESULT>,DEFAULT,-TABLE'.L
>
DEFINE SP(NAME,RESULT,PROCESSOR,ABBR),<
X NAME,PROCESSOR,<RESULT>,PD.'ABBR,MX.'ABBR
>
DEFINE SS(NAME,RESULT,VALUE),<
X NAME,0,<RESULT>,VALUE,0
>
;WORDS IN FILE SPEC AREA
.FXDEV==0 ;DEVICE
.FXNAM==1 ;NAME
.FXNMM==2 ;NAME MASK
.FXEXT==3 ;EXTENSION,,EXTENSION MASK
.FXMOD==4 ;MODIFIER WORD
.FXMOM==5 ;MODIFIER MASK
.FXDIR==6 ;DIRECTORY WORD
.FXDIM==7 ;DIRECTORY MASK
.FXBFR==22 ;/BEFORE
.FXSNC==23 ;/SINCE
;LENGTHS OF FILE SPEC AREA
.FXLEN==24 ;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
FX.PHY==1B3 ;/PHYSICAL
FX.NOM==1B4 ;/OKNONE
FX.DFX==1B5 ;DIRECTORY DOES NOT NEED FIX-UP BY WILD
FX.ADD==1B6 ;SPEC TERMINATED BY + (OBSOLETE)
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.PAR==1B24 ;/PARITY
FX.DEN==3B26 ;/DENSITY
FX.PRO==777B35 ;/PROTECTION
;SPECIAL CHARACTERS FOR SCAN
.CHALX==0 ;ALTMODE
.CHEOL==-1 ;END OF LINE
.CHEOF==-2 ;END OF FILE
;MACRO TO BUILD THE TABLES FROM THE SWTCHS MACRO
DEFINE DOSCAN(PFX),<
LIST
;TABLE OF SIXBIT SWITCH NAMES
DEFINE X(A,B,C,D,E),<
EXP SIXBIT /A/
>
PFX'N: SWTCHS
PFX'L==.-PFX'N
;TABLE OF BYTE POINTERS TO STORE RESULT
DEFINE X(A,B,C,D,E),<
..TEMP==-1
IFDIF <C><>,<
..TEMP==0
IRPC (C)<IFIDN <C><,>,<..TEMP==1
STOPI>>>
IFL ..TEMP,<0> ;A
IFE ..TEMP,<POINT 36,C,35> ;A
IFG ..TEMP,<C> ;A
>
PFX'P: SWTCHS
;TABLE OF IF LT 0, IOWD KEY TABLE
; OR IF GE 0, XWD MAX,PROCESSOR
MX.==0
DEFINE X(A,B,C,D,E),<
XWD E,B ;A
>
PFX'M: SWTCHS
;DEFAULT VALUE (RH) OR 0
PD.==0
DEFINE X(A,B,C,D,E),<
XWD 0,D ;A
>
PFX'D: SWTCHS
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
NAME'LST==NAME'.L>
>
;ASK <A> ASKS DIALOGUE QUESTION A
DEFINE ASK (A),<
EXT ASK.
PUSHJ P,ASK.
XLIST
ASCIZ \A\
>
;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
>
IF1,< ASUPPRESS>
IFDEF %.C,<IFLE %.C+2,<
IF2,<PURGE %.C,%..C>
END>> ;BIND OFF TO GET CLEAN LISTING