Google
 

Trailing-Edge - PDP-10 Archives - cuspbinsrc_1of2_bb-x128c-sb - 10,7/galaxy/glxlib/glxots.mac
There are 31 other files named glxots.mac in the archive. Click here to see a list.
TITLE GLXOTS - Primary Module for GALAXY Runtime System
SUBTTL	Irwin L. Goverman/ILG/PJT/DPM 14-Apr-88

;
;
;        COPYRIGHT (c) 1975,1976,1977,1978,1979,1980,1981,1982,
;			 1983,1984,1985,1986,1987
;                    DIGITAL EQUIPMENT CORPORATION
;			 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.

	OTSEDT==13			;MODULE EDIT

	SEARCH	GLXMAC			;LOAD COMMON DEFINITIONS
	PROLOG(GLXOTS,OTS)		;

;The purpose of this module is to provide a common access mechanism
;	for the GALAXY object time system. When the library is loaded correctly
;	this module starts at location VORG, defined in GLXMAC.
;	The only code in this module is the library dispatch vector
;	which is used to find routines and variables in the library.
;

; In the case of the library being loaded as a .REL file,
;	this module generates no code, since there is no need for an
;	dispatch vector
SUBTTL Table of Contents

;               TABLE OF CONTENTS FOR GLXOTS
;
;
;                        SECTION                                   PAGE
;    1. Table of Contents.........................................   2
;    2. Internal Loading Instructions.............................   3
;    3. Library Dispatch Vector...................................   4
SUBTTL	Revision history


COMMENT	\

005		Make GLXLIB run execute-only.
		Change entry vectors to include PORTAL instructions. That
		will clear PUBLIC mode and set CONCEALED mode. This allows
		execute-only operation.

006		Restructure GLXLIB
		 1) Do compatibility check here instead of GLXINT.
		 2) Create data pages here instead of GLXINT.
		 3) Rework CDO macro. Don't PUSHJ to the the unimplemented
		    stopcode since this may not work if execute-only.
		 4) Create new stopcodes and global symbols so that any module
		    may call them. The stopcodes are:
			.UNRTN::STOPCD(UNR,HALT,,<Unimplemented routine executed>)
			.OBRTN::STOPCD(OBR,HALT,,<Obsolete routine executed>)
			.OORTN::STOPCD(OOR,HALT,,<OTS only routine executed>)
007	4/6/81  Add "start address" for beginning of dispatch table.

012	10462	Change $STOP to STOPCD.
		14-Nov-86 /BAH

013	10616	Change K%SOUT references to OUTSTRs to avoid ill mem
		refs if GLXLIB hasn't been initialized yet.
		14-Apr-88  /DPM

\ ;End of revision history
SUBTTL	Check for neccessity of this module

;Since GLXOTS is the first module loaded, define the start of the data space

	$GDATA	D%BEG,0			;First location in the data pages
	$DATA	OTSDAT,0		;Dummy data slot for OTS
SUBTTL Library Dispatch Vector


; This vector is used by all non-OTS modules to dispatch to the
; proper routines in the OTS.
;
IFN GLXPURE,<				;;IF OTS
DEFINE	CDO	(X),<			;;MACRO TO DEFINE ENTRY POINTS
	IFB	<X>,<PORTAL  .UNRTN>	;;UNIMPLEMENTED ROUTINES
	IFNB	<X>,<			;;FOR DEFINED ENTRY POINTS...
		GLOB	X		;;DECLARE GLOBAL SYMBOM
		PORTAL	X		;;POINT TO ENTRY
	>				;;END OF IFNB <X> CONDITIONAL
>					;;END OF CDO MACRO
>					;;END OF IFN GLXPURE CONDITIONAL

IFE	GLXPURE,<			;;IF LINKABLE LIBRARY
DEFINE	CDO	(X),<			;;MACRO TO DEFINE ENTRY POINTS
	IFNB	<X>,<GLOB X>		;;DECLARE SYMBOL GLOBAL
>					;;END OF CDO MACRO
>					;;END OF IFE GLXPURE CONDITIONAL

DEFINE	NT(X),<				;;MACRO TO ALLOW GLXINI LOCAL ENTRIES
	CDO	X			;;GLXOTS MACRO IS LIKE CDO
>					;;END NT MACRO

	LSTOF.				;TURN OFF LISTING
GLXOTS::LIBVEC				;DEFINE ENTRY VECTOR
	LSTON.				;TURN ON LISTING

.UNRTN::STOPCD	(UNR,HALT,,<Unimplemented routine executed>) ;++ NON-EXISTENT ROUTINES
.OBRTN::STOPCD	(OBR,HALT,,<Obsolete routine executed>)	;++ ANCIENT ROUTINES
.OORTN::STOPCD	(OOR,HALT,,<OTS only routine executed>) ;++ SHOULD NEVER HAPPEN

IFN GLXPURE,<
COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1971,1987. ALL RIGHTS RESERVED.
\;END COPYRIGHT MACRO
>

SUBTTL	Object Time System -- Initial startup


; Here from GLXINI (the bootstrap module). This code is only needed if
; the user acceses the library as an OTS high segment.
;
; Create the library's data pages. On TOPS-10, this requires 2 PAGE. UUOs.
; The first to create the page fault handler's data page just below the high
; segment origin. The second create the actual data pages referenced by all
; GLXLIB modules. On TOPS-20, there is no page fault handler. Creating the
; data pages requires touching each page. A BLT (through a call to .ZCHNK)
; does this nicely.
;
; Once the data pages have been created, OTS initialization is completed
; by calling I%INIT in GLXINT.
;
OTSINI:
IFE GLXPURE,<				;IF LINKABLE LIBRARY
	PUSHJ	P,.OORTN		;HOW DID WE GET HERE ??
>					;END OF IFE GLXPURE CONDITIONAL

IFN GLXPURE,<				;IF OTS
	HLRZ	TF,S1			;GET VERSION # LOADED GY GLXINI
	CAIE	TF,%%.GLX		;SKEW ?
	JRST	OTSERR			;YES
	HRRZS	S1			;STRIP OFF VERSION
	PUSH	P,S1			;SAVE S1
	PUSH	P,S2			;SAVE S2
	PUSHJ	P,CREDAT		;CREATE THE PAGES
	POP	P,S2			;RESTORE S2
	POP	P,S1			;RESTORE S1
	SETOM	OTSDAT			;INDICATE GETSEG OCCURED
	PJRST	I%INIT			;COMPLETE INITIALIZATION

OTSERR:
TOPS10	<
	OUTSTR	OTSETX			;PRINT ERROR MESSAGE
	EXIT	1,			;STOP JOB
	JRST	.-1			;DON'T CONTINUE
> ;END TOPS10
TOPS20	<
	HRROI	S1,OTSETX		;POINT TO TEXT
	PSOUT				;PRINT ERROR MESSAGE
	HALTF				;STOP JOB
	JRST	.-1			;DON'T CONTINUE
> ;END TOPS20

OTSETX:	ASCIZ	|? GLXLIB version skew; recompile this program|
SUBTTL	Object Time System -- Data page creation


CREDAT:
TOPS10	<				;TOPS-10 ONLY
	MOVEI	TF,D%END##		;GET LAST PAGE LOCATION
	ADR2PG	TF			;CONVERT TO A PAGE NUMBER
	HRLI	TF,.PAGCA		;SET UP PAGE. UUO FUNCTION
	PAGE.	TF,			;READ PAGE ACCESS CODES
	  TXO	TF,PA.GNE		;CAN'T - ASSUME NOT THERE AND TRY CREATE
 	TXNN	TF,PA.GNE		;PAGE EXIST ?
	POPJ	P,			;YES - ASSUME ALL PAGES THERE AND RETURN
	MOVE	TF,[.PAGCD,,S1]		;SET UP PAGE. UUO
	MOVEI	S1,D%END##-D%BEG	;GET NUMBER OF WORDS IN THE DATA PAGES
	TXZE	S1,PAGSIZ-1		;FRACTION OF A PAGE ?
	ADDI	S1,PAGSIZ		;YES - ROUND UP
	ADR2PG	S1			;CONVERT TO PAGE NUMBER
	MOVNS	S1			;MAKE NEGATIVE REPEAT COUNT
	MOVEI	S2,D%BEG		;GET STARTING DATA PAGE ADDRESS
	ADR2PG	S2			;CONVERT TO A PAGE NUMBER
	PAGE.	TF,			;CREATE THE LIBRARY DATA PAGES
	  SKIPA				;CAN'T CREATE IN CORE
	POPJ	P,			;RETURN
	CAIE	TF,PAGLE%		;WAS ERROR CORE LIMIT EXCEEDED?
	JRST	CREERR			;NO, JUST GO DOWN THE TUBES
	MOVE	TF,[.PAGCD,,S1]		;YES, LET'S TRY TO CREATE ON DISK
	TXO	S2,PA.GCD		;LITE CREATE ON DISK BIT
	PAGE.	TF,			;LET'S TRY AGAIN
	  SKIPA				;OH WELL, WE TRIED
	POPJ	P,			;LET'S PROCEED AND SEE WHAT HAPPENS

CREERR:	OUTSTR	[ASCIZ	|? GLXOTS - Library data page create failed|]
	$HALT				;STOP
	JRST	.-1			;DON'T CONTINUE
>					;END OF TOPS-10 CONDITIONAL

TOPS20	<				;TOPS-20 ONLY
	XMOVEI	S1,D%BEG-D%END##	;GET LENGTH OF PAGE PAGES
	XMOVEI	S2,D%END##		;POINT TO LAST DATA WORD
	$CALL	.ZCHNK			;ZAP ALL WORDS
	POPJ	P,			;RETURN
>					;END OF TOPS-20 CONDITIONAL
>					;END OF IFN GLXPURE CONDITIONAL
SUBTTL	End



OTS%L:
IFN GLXPUR<
	END GLXOTS>
IFE GLXPUR<
	END>