Google
 

Trailing-Edge - PDP-10 Archives - tops10_tools_bb-fp64b-sb - 10,7/config/config.mac
There are 2 other files named config.mac in the archive. Click here to see a list.
TITLE	CONFIG - Stand Alone Driver for ORION's CONFIG Application
SUBTTL	Joseph A. Dziedzic /JAD	28-Apr-86 /RJF 15-JUL-87


	SEARCH	GLXMAC
	PROLOG	(CONFIG)

	SEARCH	ORNMAC
	PARSET			;SET UP PARSER MACROS, ETC.


;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1983,1988. 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.


;Version number

	CFGVER==1		;MAJOR VERSION
	CFGMIN==0		;MINOR VERSION
	CFGEDT==5		;EDIT LEVEL
	CFGWHO==0		;WHO LAST PATCHED


	LOC	<.JBVER==:137>
;[5]	VRSN.	(CFG)
;[5] REALY WANT OPR/ORION'S VERSION HERE SO WE KNOW WE HAVE UP-TO-DATE CODE.
	EXP	OPRVRS		;[5] ORION'S VERSION
	RELOC	0


COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1983,1986,1988. ALL RIGHTS RESERVED.
\;END OF COPYRIGHT MACRO
	SUBTTL	Data Segment


;Initialization block

INIBLK:	$BUILD	IB.SZ
	  $SET	(IB.PRG,,'CONFIG')
	  $SET	(IB.FLG,IT.OCT,1)
	$EOB


;Parser stuff

PRSBLK:	$BUILD	PAR.SZ
	  $SET	(PAR.PM,,PROMPT)
	  $SET	(PAR.TB,,MYINI)
	$EOB

PROMPT:	ASCIZ	/CONFIG>/

MYINI:	$INIT	(MYTOP)
MYTOP:	$KEYDSP	(MYCMD,$ALTERNATE(CNFFDB##))
MYCMD:	$STAB
	DSPTAB	(,-1,\"32,CM%INV)
	DSPTAB	(CONFRM,-1,<EXIT>)
	$ETAB
CONFRM::$CRLF


;Miscellaneous impure stuff

PDLIST:	BLOCK	200		;PDL

G$MJOB::BLOCK	1		;MY JOB NUMBER
G$APFG::BLOCK	1		;CNFORN WANTS TO WRITE INTO HERE
FRCLIN::BLOCK	1		;LINE NUMBER FOR FRCLIN

WTOCNT:	BLOCK	1		;CHARS LEFT IN WTO BUFFER
WTOPTR:	BLOCK	1		;BYTE POINTER INTO WTO BUFFER
MESSAG:	BLOCK	PAGSIZ		;RANDOM TEXT
MSGHDR:	BLOCK	1		;ADDRESS OF HEADER ITEXT
SAVES:	BLOCK	2		;SAVES S1/S2
G$MVER::BLOCK	1		;MONITOR VERSION NUMBER (NORMALY IN ORION)
	SUBTTL	Initialization


START:	JFCL
	RESET			;RESET ALL I/O
	MOVE	P,[IOWD 200, PDLIST] ;SET UP PDL

	MOVX	S1,IB.SZ	;SIZE OF IB
	MOVEI	S2,INIBLK	;ADDRESS OF IT
	$CALL	I%INIT		;INIT GALAXY LIBRARY

	PJOB	S1,		;MY JOB NUMBER
	MOVEM	S1,G$MJOB	;STORE IT
	MOVX	S1,%CNFLN	;GETTAB FRCLIN
	GETTAB	S1,		;...
	  HALT	.		;NEVER FAILS
	ADDI	S1,.UXTRM	;MAKE IT A TTY UDX
	MOVEM	S1,FRCLIN	;SAVE IT

	MOVE	S1,[CNFDSL##,,CNFDSL##] ;LINK IN THE EXIT COMMAND
	MOVEM	S1,CNFDSP##	; WHICH WASN'T ASSEMBLED IN
	HRROI	S1,I%EXIT##	;ADDRESS OF ROUTINE
	MOVEM	S1,CNFDSX##	;LINK IT IN AT END
	MOVX	S1,%CNVER		;GETTAB the monitor version
	GETTAB	S1,
	STOPCD	(CGV,HALT,,<Cannot GETTAB monitor version>)
	MOVEM	S1,G$MVER		;Save for interested parties
	SUBTTL	Command Parse Loop


COMAND:	PUSHJ	P,SETMSG	;SET UP MESSAGE BUFFER
	MOVX	S1,PAR.SZ	;SIZE OF PARSER BLOCK
	MOVEI	S2,PRSBLK	;ADDRESS OF IT
	$CALL	PARSER##	;PARSE THE COMMAND
	JUMPF	BADCMD		;IF ERROR

	MOVE	MI,PRT.CM(S2)	;POINT AT COMMAND
	$CALL	CNFORN##	;DO THE WORK
	PUSHJ	P,FLSMSG	;FLUSH MESSAGE BUFFER
	MOVE	S1,MI		;GET MESSAGE ADDRESS
	$CALL	M%RPAG		;RETURN THE PAGE
	JRST	COMAND		;OVER AGAIN
SUBTTL	TABSRC	Table search routine

;THIS ROUTINE WILL SEARCH A TABLE FOR A SPECIFIED VALUE AND
;RETURN THE ASSOCIATED INFO
;THE TABLE ENTRIES SHOULD HAVE CODE IN LEFT HALF AND DATA IN RIGHT HALF
;AND USE $STAB TO START THE TABLE AND $ETAB TO END IT


;CALL	S1/	ITEM TO LOOK FOR 
;	S2/	ADDRESS OF TABLE
;
;
;RETURN	S1/	ITEM TO LOOK FOR
;	S2/	ITEM FOUND IN TABLE


;WILL USE T1 AND T2 FOR SCRATCH

TABSRC::HLLZ	T1,(S2)		;GET THE NUMBER OF ENTRIES
	MOVN	T1,T1		;MAKE IT NEGATIVE
	HRRI	T1,1(S2)	;ADDRESS OF THE TABLE
TABS.1:	HLRZ	T2,(T1)		;GET THE ENTRY
	CAMN	S1,T2		;MATCH?
	JRST	TABS.2		;YES..
	AOBJN	T1,TABS.1	;TRY NEXT ONE
	$RETF			;ERROR..RETURN
TABS.2:	HRRZ	S2,(T1)		;GET THE DATA
	$RETT			;RETURN TRUE
	SUBTTL	Miscellaney


SETMSG:	MOVEI	MO,MESSAG	;POINT AT OUTPUT MESSAGE
	MOVEI	S1,PAGSIZ*5-1	;COUNT
	MOVEM	S1,WTOCNT	;SAVE IT
	MOVE	S1,[POINT 7, MESSAG] ;VIRGIN POINTER
	MOVEM	S1,WTOPTR	;SAVE IT
	$RETT			;RETURN

WTORTN::SOSG	WTOCNT		;ANY SPACE LEFT?
	$RETF			;NOPE
	IDPB	S1,WTOPTR	;STUFF A BYTE
	$RETT			;RETURN

FLSMSG:	MOVEI	S1,.CHNUL	;GET A NULL
	IDPB	S1,WTOPTR	;STUFF IT
	OUTSTR	MESSAG		;OUTPUT IT
	SETZM	MESSAG		;WE'VE DONE IT ONCE
	$RETT			;ALL DONE

INTACK::
	DMOVEM	S1,SAVES	;SAVE THE "S" REGISTERS
	HRRZ	S1,@(P)		;GET ADDRESS OF ITEXT BLOCK
	MOVEM	S1,MSGHDR	;SAVE IT
	DMOVE	S1,SAVES	;RESTORE AC'S
	$TEXT	(,<-- ^I/@MSGHDR/ --^M^J>)	;TYPE ON TERMINAL NOW
	DMOVE	S1,SAVES	;RESTORE AC'S
	$TEXT	(WTORTN,<>)	;JUST OUTPUT A CRLF
	$RETT			;RETURN

BADCMD:	$TEXT	,<?^T/@PRT.EM(S2)/>
	JRST	COMAND		;TRY AGAIN

BADCOM::MOVEI	S2,[ASCIZ /Invalid CONFIG command specified/]
	$RETF

WTIRTN::OUTCHR	S1		;OUTPUT THE CHARACTER
	JRST	.RETT##

WTIFLS::JRST	.RETT##
	SUBTTL	The End


	END	START