Google
 

Trailing-Edge - PDP-10 Archives - BB-Y390S-BM_1990 - t20src/mapper.mac
There are 20 other files named mapper.mac in the archive. Click here to see a list.
;Edit 8 to MAPPER.MAC, 11-Nov-87 11:12:20, Edit by RASPUZZI
;Make edit number decimal. Also, fixe up TCO 6.2006 so that autopatch
;folks are happy.
;TCO 6.2006 - Remove edit 4; this allows MAPPER to build under version 6
;Edit 7 to MAPPER.MAC by LOMARTIRE on Mon 6-Jun-83, for SPR #18820
;		Update minor version to 1 and remove ERJMPs in edit 6
;Edit 6 to MAPPER.MAC by LOMARTIRE on Wed 1-Jun-83, for SPR #18820
;		Add identification before error and warning messages
; UPD ID= 59, FARK:<5-1-WORKING-SOURCES.UTILITIES>MAPPER.MAC.3,  10-Nov-82 14:26:21 by WEETON
;Edit 5 - update version number to 5.
; UPD ID= 7, FARK:<5-WORKING-SOURCES.UTILITIES>MAPPER.MAC.2,   8-Apr-82 11:57:19 by ZIMA
;Edit 4 - add code to allow running under 4.1 or 5.
;<5.UTILITIES>MAPPER.MAC.5, 28-Oct-81 15:24:56, EDIT BY GRANT
;Change major version to 5
; UPD ID= 1694, SNARK:<5.UTILITIES>MAPPER.MAC.4,  12-Mar-81 11:55:54 by GRANT
;Update Copyright
; UPD ID= 1579, SNARK:<5.UTILITIES>MAPPER.MAC.3,  24-Feb-81 17:02:09 by BLOUNT
;UPDATE VERSION NUMBER TO 5
; UPD ID= 1288, SNARK:<5.UTILITIES>MAPPER.MAC.2,  18-Nov-80 14:51:17 by OSMAN
;Change GET to reflect new args
;<4.1.UTILITIES>MAPPER.MAC.2,  9-Nov-79 10:42:46, 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,1981 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	TITLE MAPPER - PROGRAM TO LOAD THE PROGRAM NAME CACHE

	SEARCH MONSYM,MACSYM

	SALL

;REVISION HISTORY
;
;4	JGZ	8-APR-82
;	Add code to enable running under either 4.1 or 5 or later.
;
;5	RWW	10-NOV-82
;	Update version number to 5.
;
;6	DML	1-JUN-83
;	Place identification before error and warning messages
;
;7	DML	6-JUN-83
;	Update minor version number to 1 and remove ERJMPs in edit 6
;
;END REVISION HISTORY


;VERSION NUMBER

	VMAJOR==5		;MAJOR VERSION
	VMINOR==1		;MAINTENANCE RELEASE NUMBER
	VEDIT==^D8+VI%DEC	;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 [	HRROI T1,[ASCIZ/?MAPPER: /]  ;GET FATAL ID
		PSOUT		;PRINT IT
		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 [	HRROI T1,[ASCIZ/%MAPPER: /]  ;GET NON-FATAL ID
		PSOUT		;PRINT IT
		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
	MOVX T1,GT%ARG		;SAY ARG BLOCK IN AC2
	MOVEI T2,[	GT%CCH]	;SAY TO CLEAR CACHE
	GET			;DO IT
	 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%ARG		;SAY ARG BLOCK ADDRESS IN AC2
	HRL T1,FORK		;GET THE FORK TO LOAD INTO
	MOVEI T2,[	GT%CSH]	;SAY TO CACHE THIS PROGRAM
	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>