Google
 

Trailing-Edge - PDP-10 Archives - BB-H138D-BM - 5-1-sources/rnfscc.mac
There are 16 other files named rnfscc.mac in the archive. Click here to see a list.
;<3-UTILITIES>RNFSCC.MAC.3,  8-Nov-77 10:50:22, EDIT BY KIRSCHEN
;MORE COPYRIGHT UPDATING...
UNIVERSAL ..SCNM -- MACRO TO DEFINE SCAN SYMBOLS
	SUBTTL	COMMAND SCANNER MACROS   %10(205)	18-AUG-75


SCMWHO==0		;WHO LAST EDITTED
SCMVER==7		;DEC VERSION
SCMMIN==0		;DEC MINOR VERSION
SCMEDT==205		;DEC EDIT VERSION



;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	XLIST			;MACRO DEF
DEFINE	SCNM(NM,OS,LFLG),<
	LFLG
	LALL
	UNIVERSAL SCNM'NM -- SCAN PARAMETERS FOR TOPS-OS


	SYN	IFE,IF
	TOPS==OS

	SEARCH	MACTEN	;GET MACTEN MACROS
%%MACTEN==%%MACTEN	;SHOW VERSION OF MACTEN


%%SCNM==VRSN. (SCM)

	PURGE	SCMWHO,SCMVER,SCMMIN,SCMEDT
;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
;%7(105) OCT, 1974 WITH SCAN 7

;201	SIMPLIFY DOSCAN ANALYSIS (NO CHANGE IN CALL)
;202	ADD .FLASK, .FLTEL, .FLQUI
;203	ELIMINATE SCNMAC.REL IF UNIVERSAL
;204	UPDATE FOR TOPS-20
;205	PRODUCE SEPERATE .UNV FILES
;WORDS IN FILE SPEC AREA

.FXZER==0	;FIRST WORD IN BLOCK (TOPS-10 OR TOPS-20)

IF TOPS-10,<
.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
.X==0		;TOPS-10 OFFSET
> ;END TOPS-10 CASE
IF TOPS-20,<
.FXFIL==0	;FILE SPEC (^D26 WORD ASCIZ STRING)
.FXJFN==^D26	;JFN IF ANY
.FXPRO==^D27	;PROTECTION
.FXACT==^D28	;ACCOUNT STRING
.FXMOD==^D36	;MODIFIER WORD
.FXMOM==^D37	;MODIFIER MASK
.X==.FXMOM-21	;TOPS-20 OFFSET
>
.FXBFR==22+.X	;/BEFORE
.FXSNC==23+.X	;/SINCE
.FXABF==24+.X	;/ABEFORE
.FXASN==25+.X	;/ASINCE
.FXFLI==26+.X	;FILE MIN SIZE (WORDS)
.FXFLM==27+.X	;FILE MAX SIZE (WORDS)
.FXEST==30+.X	;/ESTIMATE
.FXVER==31+.X	;/VERSION

;LENGTHS OF FILE SPEC AREA
.FXLEN==32+.X	;LENGTH OF ONE SPECIFICATION
IF TOPS-10,<
.FXLND==6	;LENGTH OF DIRECTORY (UFD+SFD'S)
> ;END TOPS-10
IF TOPS-20,<
.FXLNF==^D26	;LENGTH OF FILE SPEC STRING
>
;BYTES IN SCAN MOD WORD
IF TOPS-10,<
FX.NDV==1B0	;NULL DEVICE
FX.NUL==1B1	;NULL EXTENSION
FX.DIR==1B2	;DIRECTORY SPECIFIED   (MOD=0 IF [-])
> ;END TOPS-10
FX.PHY==1B3	;/PHYSICAL
FX.NOM==1B4	;/OKNONE
IF TOPS-10,<
FX.DFX==1B5	;DIRECTORY DOES NOT NEED FIX-UP BY WILD
> ;END TOPS-10
IF TOPS-20,<
FX.TMP==1B5	;FILE IS TEMP
>
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
IF TOPS-10,<
FX.PRO==777B35	;/PROTECTION
> ;END TOPS-10
;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

;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	;/MESSAGE:CONTINUATION
JWW.FL==1B34	;/MESSAGE:FIRST
JWW.PR==1B35	;/MESSAGE:PREFIX

;VALUES IN .FLAQT

.FLASK==1	;/ASK
.FLTEL==2	;/TELL
.FLQUI==3	;/QUIET
;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)

		;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
>
IFNB <$POINT>,<IFE ..TEMP,<
	$POINT			;$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)<IFIDN <LST><*>,<..TEMP==1>
					STOPI>
			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
>
	LIST
> ;END DEF OF SCNM
	LIST
	PRGEND
	SEARCH	..SCNM
	SCNM(10,10,LIST)
	PRGEND
	SEARCH	..SCNM
	SCNM(AC,10,XLIST)
	PRGEND
	SEARCH	..SCNM
	SCNM(20,20,LIST)
	END