Google
 

Trailing-Edge - PDP-10 Archives - BB-D868D-BM - 4-sources/mapper.mac
There are 20 other files named mapper.mac in the archive. Click here to see a list.
;<4.UTILITIES>MAPPER.MAC.8,  3-Jan-80 15:26:02, EDIT BY R.ACE
;UPDATE COPYRIGHT DATE
;<4.UTILITIES>MAPPER.MAC.7,  9-Nov-79 10:41:52, EDIT BY DBELL
;TCO 4.2569 - DON'T DO RLJFN AFTER GET JSYS
;<4.UTILITIES>MAPPER.MAC.6,  7-May-79 12:38:32, EDIT BY KIRSCHEN
;REMOVE EXTRA BRACKET ON ERJMP AFTER GET
;<4.UTILITIES>MAPPER.MAC.5,  7-May-79 11:33:54, EDIT BY HURLEY
;CLEAR THE CACHE BEFORE LOADING IT
;<4.UTILITIES>MAPPER.MAC.4,  2-May-79 13:25:32, EDIT BY KIRSCHEN
;ADD ERROR MESSAGE IF GET FAILS
;<4.UTILITIES>MAPPER.MAC.3, 10-Mar-79 14:16:56, Edit by KONEN
;UPDATE COPYRIGHT FOR RELEASE 4
;<4.UTILITIES>MAPPER.MAC.1, 16-Nov-78 14:17:56, EDIT BY HURLEY

;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,1979,1980 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	TITLE MAPPER - PROGRAM TO LOAD THE PROGRAM NAME CACHE

	SEARCH MONSYM,MACSYM

	SALL

;VERSION NUMBER

	VMAJOR==4		;MAJOR VERSION
	VMINOR==0		;MAINTENANCE RELEASE NUMBER
	VEDIT==1		;EDIT NUMBER
	VWHO==0			;CUSTOMER EDIT NUMBER

	VMAPPER==<VWHO>B2!<VMAJOR>B11!<VMINOR>B17!VEDIT

ENTVEC:	JRST START		;START POINT
	JRST START		;REENTER
	VMAPPER			;VERSION NUMBER

;AC DEFINITIONS - TOPS-20 STANDARDS APPLY

	T1=1			;TEMPORARY ACS
	T2=2
	T3=3
	T4=4
	Q1=5			;PERMANENT ACS
	Q2=6
	Q3=7
	P1=10			
	P2=11
	P3=12
	P4=13
	P5=14
	P6=15
	CX=16			;TEMP
	P=17			;PUSH DOWN POINTER

	FPAG==10		;FIRST PAGE TO USE FOR MAPPING
	LPAG==770-NPAG		;LAST PAGE FOR MAPPING
	NPAG==2			;NUMBER OF PAGES TO BE MAPPED

DEFINE ERRMES (A) <		;FATAL ERROR
	JRST [	MOVEI T1,.PRIOU	;OUTPUT ERROR INFO TO CONTROLING TTY
		HRLOI T2,.FHSLF
		SETZ T3,
		ERSTR
		 JFCL
		 JFCL
		HRROI T1,A	;OUTPUT REMAINDER OF MESSAGE
		PSOUT
		HALTF		;THEN STOP
		JRST START]>

DEFINE WARN (A,B) <		;WARNING MESSAGE - NON-FATAL
	JRST [	MOVEI T1,.PRIOU
		HRLOI T2,.FHSLF
		SETZ T3,
		ERSTR
		 JFCL
		 JFCL
		MOVEI T1," "
		PBOUT
		HRROI T1,B	;OUTPUT THE WARNING MESSAGE
		PSOUT
		HRROI T1,[ASCIZ/
/]
		PSOUT
		A]>		;DO THE INSTRUCTION SUPPLIED IN CALL

START:	RESET			;INITIALIZE THE WORLD
	MOVE P,[IOWD PDLEN,PDL]	;SET UP A PUSH DOWN LIST
	MOVEI T1,.FHSLF
	SETOB T2,T3
	EPCAP			;ENABLE WHEEL OR OPERATOR
	MOVEI T1,FPAG		;INIT STARTING VARIABLES
	MOVEM T1,MPAG		;FIRST FREE PAGE FOR MAPPING IN NON-EXE FILES
	MOVEI T1,.FHSLF		;USE THE CURRENT FORK BEFORE GETTING ANOTHER
	MOVEM T1,FORKH
	MOVEI T1,0		;CLEAR THE PROGRAM NAME CACHE
	GET			;GET WITH AC 1 = 0 CLEARS THE CACHE
	 ERJMP .+1
	MOVSI T1,(GJ%SHT!GJ%OLD)
	HRROI T2,[ASCIZ/SYSTEM:PROGRAM-NAME-CACHE.TXT/]
	GTJFN			;LOOKUP THE LIST OF FILES TO BE CACHED
	 ERRMES (<[ASCIZ/SYSTEM:PROGRAM-NAME-CACHE.TXT/]>)
	MOVEM T1,PNCJFN		;SAVE THE JFN
	MOVE T2,[070000,,OF%RD]
	OPENF			;OPEN THE LIST OF FILES
	 ERRMES <[ASCIZ/SYSTEM:PROGRAM-NAME-CACHE.TXT/]>
LOOP:	MOVEI P1,5		;SET UP TO READ IN A LINE FROM THE LIST
	MOVE P2,[RD%TOP!RD%JFN]	;BREAK ON CR-LF
	HRLZ P3,PNCJFN		;GET JFN OF FILE
	HRRI P3,377777
	HRROI P4,STRING		;READ LINE INTO STRING
	MOVEI P5,STRINC		;LENGTH OF STRING AREA
	MOVEI T1,P1
	TEXTI			;READ IN A LINE
	 ERJMP DONE		;IF NO MORE, THEN DONE
	MOVSI T1,(GJ%SHT!GJ%OLD)
	HRROI T2,STRING		;NOW LOOKUP THE FILE INDICATED IN LIST
	GTJFN
	 WARN (<JRST LOOP>,<STRING>)
	MOVEM T1,JFN		;SAVE THE JFN
	HRROI T1,TYPSTR
	HRRZ T2,JFN
	MOVX T3,1B11
	JFNS			;GET THE FILE TYPE
	MOVE T1,TYPSTR
	CAMN T1,[ASCIZ/EXE/]	;IS THIS AN .EXE FILE?
	JRST LOOP1		;YES, GO DO A GET JSYS
	HRRZ T1,JFN		;NO, USE PMAP TO MAP IN THE PAGES
	MOVE T2,[440000,,OF%RD]	;MAP IT FOR READ ONLY
	OPENF			;OPEN THE FILE TO BE CACHED
	 WARN (<JRST LOOP>,<STRING>)
	FFFFP			;MAP UP TO THE FIRST HOLE
	HRRZ T3,T1		;GET THE NUMBER OF PAGES IN THE FIRST BLOCK
	CAIL T3,LPAG		;MAKE SURE IT WILL FIT IN A FORK
	MOVEI T3,LPAG-1		;IF NOT, THEN LIMIT IT TO ONE FORK
	MOVE T2,MPAG		;GET THE START OF THE AREA TO MAP INTO
	ADD T2,T3
	CAILE T2,LPAG		;IS THERE ENOUGH ROOM IN THIS FORK?
	JRST [	SETZ T1,
		CFORK		;NO, GET ANOTHER FORK
		 JRST LOOP
		MOVEM T1,FORKH	;SAVE THE NEW FORK HANDLE
		SETZM MPAG	;START AT THE BEGINNING
		JRST .+1]
	HRLZ T1,JFN		;NOW MAP THE FILE
	MOVE T2,MPAG		;STARTING AT MPAG
	HRL T2,FORKH		;INTO THE DESIGNATED FORK
	HRLI T3,(PM%CNT!PM%RD)	;T3 HAS THE COUNT OF PAGES
	PMAP			;LEAVING THE PAGES MAPPED REDUCES THE 
				;  ACCESS TIME FOR SUBSEQUENT MAPPINGS
				;  BY OTHER USERS
	HRRZ T1,T3
	ADDM T1,MPAG		;UPDATE THE STARTING FREE PAGE
	JRST LOOP		;LOOP BACK FOR OTHER FILES IN LIST

LOOP1:	SETZB T1,T2		;GET A FORK TO DO THE GET INTO
	CFORK			
	 WARN (<JRST LOOP3>,<STRING>)
	MOVEM T1,FORK		;SAVE THE FORK HANDLE
	HRRZ T1,JFN		;GET THE JFN OF THE .EXE FILE
	TXO T1,GT%FL2		;MARK THAT THE EXTENDED FLAGS ARE GIVEN
	HRL T1,FORK		;GET THE FORK TO LOAD INTO
	SETZ T2,
	MOVX T3,G2%FCH		;CAUSE THIS TO BE CACHED
	GET			;GET THE EXE FILE 
	 ERJMP [WARN (<JRST LOOP3>,STRING)]
LOOP2:	HRRZ T1,FORK
	KFORK			;KILL THE FORK (THE FILE REMAINS CACHED)
	JRST LOOP		;LOOP BACK (WITHOUT DOING THE RLJFN!!)

LOOP3:	HRRZ T1,JFN		;RELEASE THE JFN
	RLJFN
	 JFCL
	JRST LOOP		;LOOP BACK FOR THE OTHER FILES

DONE:	HRRZ T1,PNCJFN		;CLOSE THE LIST FILE
	CLOSF
	 JFCL
	WAIT			;GO INTO AN ENDLESS SLEEP
	HALTF
	JRST .-1

	PDLEN==20
PDL:	BLOCK PDLEN		;PUSH DOWN LIST

	STRNGL==40
	STRINC=STRNGL*5-1
STRING:	BLOCK STRNGL		;TEMP STRING
TYPSTR:	BLOCK 10
MPAG:	0			;FIRST FREE PAGE IN MAPPER FORK
JFN:	0			;JFN OF FILE BEING MAPPED
FORK:	0			;FORK TO DO GET'S INTO
FORKH:	0			;FORK TO DO MAP'S INTO
PNCJFN:	0			;JFN OF LIST FILE

	END <3,,ENTVEC>