Google
 

Trailing-Edge - PDP-10 Archives - bb-h138f-bm - 7-sources/rtldyn.mac
There are 3 other files named rtldyn.mac in the archive. Click here to see a list.
TITLE RTLDYN -- RTL library interface

;
;	COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1984, 1986.
;	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 THAT IS NOT SUPPLIED BY DIGITAL.
;
SUBTTL Edit History

; Version 1.0

; Version 1.1

;.EDIT 50	Formally go to version 1.1, update copyright, insert V1.1
;			development changes (formally V2)
;		DDB,15-Jan-85,SPR:NONE
;.EDIT 51	Add GLOBbing in build procedure, make DY$CBK work from JCK.
;		DDB,30-Apr-85,SPR:NONE
;.EDIT 55	Add RL$2BG -- convert two-word byte-pointer to OWG.
;		DDB,10-JUN-85,SPR:NONE

SEARCH DDBSYM,DYNSYM,RTLDYN,MONSYM,MACSYM

SALL

SEGMENT DATA

; For ease in debugging, define names for DDT in various sections
DD1==1,,770000
DD2==2,,770000
DD3==3,,770000
DD4==4,,770000

; Declare all exported addresses not defined in this module as external

; Routines

EXTERN	ABS.,	ACOS.,	AIMAG.,	AINT.,	ALG10.,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RAN
EXTERN	SETRAN,	SG$ALC,	SG$DIC,	SG$DLC,	SG$DLG,	SG$DMG,	SG$EIC,	SG$EST
EXTERN	SG$LES,	SG$LRM,	SG$PEM,	SG$REM,	SG$SEC,	SG$SIG,	SIGN.,	SIN.
EXTERN	SIND.,	SINH.,	SNGL.,	SQRT.,	TAN.,	TANH.,	SG$NAS,	DY$CBK
EXTERN	RL$LBG
EXTERN	RL$NUL			;[51]
EXTERN	RL$2BG			;[55]

; Galactic variables

EXTERN	ENSTK,	SG.ENS,	SG.LEV,	SG.PFX,	SG.SFX,	SG.DPX,	SG.DSX,	SG.OUT
EXTERN	SG.NAS
EXTERN	DY.ZMP			;[51]

; DLBLK for run-time library

	$DLBLK $RTL
SUBTTL RL$MIN -- Master-initialization routine for the run-time library

EXTERNAL ERCNKS, ERCNKE, RTCNKS, RTCNKE, RT.CKS, RT.CKE, CNKMAX
EXTERNAL SG.LER

SEGMENT CODE

; Need not preserve any registers.
; Trapping (and interrupts) are (will be) turned on during the call to
; DY$MIN.  They aren't enabled here because that causes problems for section
; zero support.  See SG.NAS / SG$NAS for more details.

; Return non-zero in T1 on error

RL$MIN::

; For signalling
	XMOVEI T0, ENSTK-1
	MOVEM T0, SG.ENS	;Establish stack pointer
	SETZM SG.LER		;No last error
	SETZM SG.NAS		;Trapping on by default

; Set up for MTHDYN error processing
EXTERNAL ERRSTK,ERSTKP,%FSECT,PDLBOT
	XMOVEI T1,ERRSTK	;SET UP ERROR STACK
	MOVEM T1,ERSTKP
	XHLLI T1, .		;Get our section number
	HLLZM T1,%FSECT		;RECORD OUR RUNNING SECTION
	XMOVEI T1, -60(P)
	MOVEM T1, PDLBOT
	;Actual enabling of traps done within DY$MIN

; LDH parameters
	MOVX T0, .INFIN
	MOVEM T0, SG.LEV
	XMOVEI T0, SG.DPX
	MOVEM T0, SG.PFX
	XMOVEI T0, SG.DSX
	MOVEM T0, SG.SFX
	MOVX T0, .PRIOU
	MOVEM T0, SG.OUT

; Memory management
  ; Clear out chunk table
	MOVE T0, [RT.CKS,,RT.CKS+1]
	SETZM RT.CKS
	BLT T0, RT.CKS+CNKMAX-1
	MOVE T0, [RT.CKE,,RT.CKE+1]
	SETZM RT.CKE
	BLT T0, RT.CKE+CNKMAX-1

  ; The special error chunk -- used for error processing (less likely to run
  ; out in the middle of an error this way)

	XMOVEI T1, ERCNKS	;Start address
	XMOVEI T2, ERCNKE	;End address
	CALL ME$MEM		;Chunk initiialization
	CAIE T1, .MEERR
	    HALTF%

  ; The RTL general use chunk (eventually to be allocated from LINK memory
  ; map, but for now statically allocated)
	XMOVEI T1, RTCNKS	;Start address
	XMOVEI T2, RTCNKE	;End address
	CALL ME$MEM		;Chunk initialization
	CAIE T1, .MERTL
	    HALTF%

	SETZB T0, T1

	RET
SUBTTL MAKPDV -- Hack to make PDV until LINK can do it

INTERN RTLPDV			;Need to know where this is in DY$MIN
				;to avoid duplicate initialization of self

MAKPDV:	$LIBPDV $RTL,,,RTLPDV

	MOVX T1, .FHSLF
	MOVX T2, 0
	SEVEC%
	  ERJMP .+1

	HALTF%
	JRST .-1

	END MAKPDV