LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)     100  HISTORY		; Detailed Current Edit History

   (3)     100  DECLARATIONS

   (4)     100  LIB$INITIALIZE - Library initialization procedu

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   1

00-10                                                                                                                            (1)



                                     0000   100 	.TITLE	LIB$INITIALIZE		; Library initialization dispatcher 

                                     0000   200 	.IDENT	/00-10/			; File: LIBINITIA.MAR

                                     0000   300 

                                     0000   400 ;

                                     0000   500 ; Copyright (C) 1977

                                     0000   600 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000   700 ;

                                     0000   800 ; This software is furnished under a license for use only on a single

                                     0000   900 ; computer  system  and  may be copied only with the inclusion of the

                                     0000  1000 ; above copyright notice. This software, or any other copies thereof,

                                     0000  1100 ; may not be provided or otherwise made available to any other person

                                     0000  1200 ; except for use on such system and to one who agree to these license 

                                     0000  1300 ; terms.  Title to  and  ownership of the software shall at all times 

                                     0000  1400 ; remain in DEC.

                                     0000  1500 ;

                                     0000  1600 ; The information in the software is subject to change without notice

                                     0000  1700 ; and should  not  be construed  as a commitment by Digital Equipment 

                                     0000  1800 ; Corporation.

                                     0000  1900 ;

                                     0000  2000 ; DEC assumes  no  responsibility  for the use or  reliability of its

                                     0000  2100 ; software on equipment which is not supplied by DEC.

                                     0000  2200 ;

                                     0000  2300 ;++

                                     0000  2400 ; FACILITY: RUN-TIME UTILITY PROCEDURE LIBRARY

                                     0000  2500 ;

                                     0000  2600 ; ENVIRONMENT:  User mode - not re-entrant.  Called only once 

                                     0000  2700 ;		per image activation.

                                     0000  2800 ;

                                     0000  2900 ;

                                     0000  3000 ; ABSTRACT:

                                     0000  3100 ;

                                     0000  3200 ;	LIB$INITIALIZE is a software architecture procedure

                                     0000  3300 ;	which permits any library or user modular procedure to specify an initialization p

                                     0000  3400 ;	to be called before the main program is called.

                                     0000  3500 ;	The initialization procedure can perform any once per-image

                                     0000  3600 ;	activation initialization which cannot be performed by the usual

                                     0000  3700 ;	compile-time and link-time static data initialization.

                                     0000  3800 ;

                                     0000  3900 ;--

                                     0000  4000 ;

                                     0000  4100 ; VERSION: 0

                                     0000  4200 ;

                                     0000  4300 ; HISTORY:

                                     0000  4400 ;

                                     0000  4500 ; AUTHOR:

                                     0000  4600 ;	Thomas N. Hastings, 6-Aug-77: Version 0

                                     0000  4700 ;

                                     0000  4800 ; MODIFIED BY:

                                     0000  4900 ;

                                     0000  5000 ;

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   2

00-10           HISTORY  ; Detailed Current Edit History                                                                         (2)



                                     0000   100 	.SBTTL	HISTORY		; Detailed Current Edit History

                                     0000   200 

                                     0000   300 

                                     0000   400 ; Edit History for Version 0

                                     0000   500 ;

                                     0000   600 

                                     0000   700 ; 0-01	- initial version TNH 12-SEP-77

                                     0000   800 ; 0-4	- Declare PSECT LIB$CODE SHR.  TNH 19-Dec-77

                                     0000   900 ; 00-05	- Return after main prog., using OWN storage.  TNH 6-Jan-78.

                                     0000  1000 ; 00-08 - Change PSECT to LIB$CODE_NOSHR.  JMT 25-Jan-78

                                     0000  1100 ; 00-09	- Declare PSECT GBL.  TNH 10-Jun-78

                                     0000  1110 ; 00-10	- .PSECT LIB$DATA NOPIC.  TNH 28-June-78

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   3

00-10           DECLARATIONS                                                                                                     (3)



                                     0000   100 	.SBTTL	DECLARATIONS

                                     0000   200 

                                     0000   300 ;

                                     0000   400 ; INCLUDE FILES:

                                     0000   500 ;

                                     0000   600 	$SFDEF				; hardware symbols for stack frame

                                     0000   700 

                                     0000   800 ;

                                     0000   900 ; EXTERNAL SYMBOLS:

                                     0000  1000 ;

                                     0000  1100 	.DSABL	GBL			; Force .EXTRN declarations for externals

                                     0000  1200 ;

                                     0000  1300 ; MACROS:

                                     0000  1400 ;

                                     0000  1500 

                                     0000  1600 ;

                                     0000  1700 ; PSECT DECLARATIONS:

                                     0000  1800 ;

                                 00000000  1900 	.PSECT	LIB$INITIALIZDZ NOPIC,USR,CON,REL,GBL,NOSHR,NOEXE,RD,NOWRT,LONG

                                     0000  2000 INIT_TABLE_BEG:				; First entry in table

                                 00000000  2100 	.PSECT	LIB$INITIALIZD_ NOPIC,USR,CON,REL,GBL,NOSHR,NOEXE,RD,NOWRT,LONG

                                     0000  2200 					; Contribution from OTS$STARTUP

                                 00000000  2300 	.PSECT	LIB$INITIALIZE  NOPIC,USR,CON,REL,GBL,NOSHR,NOEXE,RD,NOWRT,LONG

                                     0000  2400 					; Contributions from rest of library and users

                                 00000000  2500 	.PSECT	LIB$INITIALIZE$ NOPIC,USR,CON,REL,GBL,NOSHR,NOEXE,RD,NOWRT,LONG

                                     0000  2600 INIT_TABLE_END:

                           00000000  0000  2700 	.LONG	0			; End of startup list

                                     0004  2800 

                                     0004  2900 					; The code for this module

                                     0004  3000 ;

                                     0004  3100 ; EQUATED SYMBOLS:

                                     0004  3200 ;

                                     0004  3300 ;

                                     0004  3400 ; OWN STORAGE:

                                     0004  3500 ;

                                     0004  3600 

                                 00000000  3700 	.PSECT	LIB$DATA	PIC,USR,CON,REL,LCL,NOSHR,NOEXE,RD,WRT

                                     0000  3800 

                                     0000  3900 DISP_PTR:				; OWN variable containing

                           00000004  0000  4000 	.BLKL	1			; pointer to initialization dispatch table

                                     0004  4100 SAV_START_ADR:				; OWN variable to save original

                           00000008  0004  4200 	.BLKL	1			; value of START_ADR_ADR arg list entry

                           0000000C  0008  4300 SAV_AP:	.BLKL	1			; saved value of AP when called

                                     000C  4400 					; needed to find original arg list

                                     000C  4500 					; on co-routine call back.

                                     000C  4600 

                                 00000000  4700 	.PSECT	LIB$CODE_NOSHR	PIC,USR,CON,REL,LCL,SHR,EXE,RD,NOWRT

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   4

00-10           LIB$INITIALIZE - Library initialization procedu                                                                  (4)



                                     0000   100 	.SBTTL	LIB$INITIALIZE - Library initialization procedure dispatcher 

                                     0000   200 

                                     0000   300 ;++

                                     0000   400 ; FUNCTIONAL DESCRIPTION:

                                     0000   500 ;

                                     0000   600 ;	LIB$INITIALIZE is a library procedure for initializing

                                     0000   700 ;	library and user procedures at run-time which cannot

                                     0000   800 ;	be done statically at compile-time or link-time.

                                     0000   900 ;	LIB$INITIALIZE is called before the main program

                                     0000  1000 ;	if the GLOBAL symbol LIB$INITIALIZE is defined.  User procedures

                                     0000  1100 ;	and library procedures need only declare LIB$INITIALIZE

                                     0000  1200 ;	as an EXTERNAL (the compiler generates EXTERNAL OTS$LINKAGE

                                     0000  1300 ;	which generates the EXTERNAL LIB$INITIALIZE).

                                     0000  1400 ;	LIB$INITIALIZE calls every entrypoint contributed to

                                     0000  1500 ;	PSECT LIB$INITIALIZE.

                                     0000  1600 ;	Note:  this procedure is not re-entrant.  It can only be called

                                     0000  1700 ;	once per image activation as currently coded.   If multiple

                                     0000  1800 ;	main programs exist in an image, all but the first should be called

                                     0000  1900 ;	directly, rather than calling through the image startup list

                                     0000  2000 ;	setup by the linker.

                                     0000  2100 ;

                                     0000  2200 ; CALLING SEQUENCE:

                                     0000  2300 ;

                                     0000  2400 ;	Status.wlc.v = LIB$INITIALIZE (start_adr_adr.ma.r, cli_co_rout.flc.r, ...)

                                     0000  2500 

                                     0000  2600 ;

                                     0000  2700 ; INPUT PARAMETERS:

                                     0000  2800 ;

                           00000004  0000  2900 	START_ADR_ADR = 4		; Adr. of the entry

                                     0000  3000 					; in the image startup vector

                                     0000  3100 					; which is used to perform the call.

                                     0000  3200 

                                     0000  3300 ;

                                     0000  3400 ; IMPLICIT INPUTS:

                                     0000  3500 ;	NONE

                                     0000  3600 ;

                                     0000  3700 ; OUTPUT PARAMETERS:

                                     0000  3800 ;	NONE

                                     0000  3900 ;

                                     0000  4000 ; IMPLICIT OUTPUTS:

                                     0000  4100 ;	NONE

                                     0000  4200 ;

                                     0000  4300 ; COMPLETION CODES:

                                     0000  4400 ;

                                     0000  4500 ;	The completion code returned from the main program.

                                     0000  4600 ;

                                     0000  4700 ; SIDE EFFECTS:

                                     0000  4800 ;	Violates VAX-11 Procedure Calling standard by modifying arg list entry START_ADR_A

                                     0000  4900 ;	Increments it by 4 to point to main program starting address.

                                     0000  5000 ;	This violation is acceptable, since LIB$INITIALIZE only called

                                     0000  5100 ;	by CLI and debugger.

                                     0000  5200 ;--

                                     0000  5300 

                                     0000  5400 

                                     0000  5500 

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   5

00-10           LIB$INITIALIZE - Library initialization procedu                                                                  (5)



                               4000' 0000   100 	.ENTRY	LIB$INITIALIZE, ^M<IV>	; entry point and entry mask

                                     0002   200 					; enable integer overflow

   00000008'EF            5C     D0  0002   300 	MOVL	AP, SAV_AP		; save AP for co-routine restore

                       04 AC     D0  0009   400 	MOVL	START_ADR_ADR(AP), -	; save pointer to startup list in OWN 

                 00000004'EF         000C   500 		SAV_START_ADR		; storage (SAV_START_ADR)

         04 AC         4F'AF     DE  0011   600 	MOVAL	B^CO_ROUT, -		; change arg list entry in case

                                     0016   700 		START_ADR_ADR(AP)	; an initialization procedure is called.

                 00000000'EF     DE  0016   800 	MOVAL	INIT_TABLE_BEG, -	; initialize OWN storage (DISP_PTR)

                 00000000'EF         001C   900 		DISP_PTR		; to first address of user/library

                                     0021  1000 

                                     0021  1100 ;+

                                     0021  1200 ; Loop to scan table of user and library initialization procedure

                                     0021  1300 ; starting addresses in PSECT LIB$INITIALIZDZ, LIB$INITIALIZD_,

                                     0021  1400 ; LIB$INITIALIZE, and LIB$INITIALIZE$

                                     0021  1500 ;-

                                     0021  1600 

            50   00000000'FF     D0  0021  1700 LOOP:	MOVL	@DISP_PTR, R0		; R0 = next user/library initialization

                                     0028  1800 					; procedure address

                          14     13  0028  1900 	BEQL	CALL_MAIN		; zero means end of list

            60            6C     FA  002A  2000 	CALLG	(AP), (R0)		; call next user/library init proc.

                 00000000'FF     D5  002D  2100 	TSTL	@DISP_PTR		; test if dispatch address is zero

                          19     13  0033  2200 	BEQL	RET			; if yes, this must be return from

                                     0035  2300 					; user initialization proc. which had

                                     0035  2400 					; done co-routine call-back.

                                     0035  2500 					; There fore this is return from main

                                     0035  2600 					; program, so return to caller (of LIB$INITIALIZE or

                                     0035  2700 					; caller or initializtion procedure)

                                     0035  2800 					; may loop thru here for each init proc which co-routined

                                     0035  2900 

                                     0035  3000 ;+

                                     0035  3100 ; Here from co-routine call-back from an initialization routine

                                     0035  3200 ;-

                                     0035  3300 

                                     0035  3400 DISPATCH_CONT:				; continue dispatching to initialization procedures

   00000000'EF            04     C0  0035  3500 	ADDL	#4, DISP_PTR		; step dispatch pointer to next

                                     003C  3600 					; init. proc. address

                          E3     11  003C  3700 	BRB	LOOP			; loop

                                     003E  3800 

                                     003E  3900 ;+

                                     003E  4000 ; Here when entire initialization list has been scanned

                                     003E  4100 ; Call main program

                                     003E  4200 ;-

                                     003E  4300 

                                     003E  4400 CALL_MAIN:				; here to call main program

   00000004'EF            04     C1  003E  4500 	ADDL3	#4, SAV_START_ADR, -	; Restore initial argument and step

                       04 AC         0045       

                                     0047  4600 		START_ADR_ADR(AP)	; to next longword in image startup vector.

            50         04 BC     D0  0047  4700 	MOVL	@START_ADR_ADR(AP), R0	; R0 = next start address (main program)

            60            6C     FA  004B  4800 	CALLG	(AP), (R0)		; call main program or main procedure

                                 04  004E  4900 RET:	RET				; R0 = status returned by main program

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   6

00-10           LIB$INITIALIZE - Library initialization procedu                                                                  (7)



                                     004F   100 

                                     004F   200 ;+

                                     004F   300 ; Co-routine - may be called by library or user initialization procedure.

                                     004F   400 ; Set AP to value it had when LIB$INITIALIZE originally called.

                                     004F   500 ; This lets LIB$INITIALIZE re-use the same argument list 

                                     004F   600 ;-

                                     004F   700 

                                     004F   800 CO_ROUT:

                               4000  004F   900 	.WORD	^M<IV>			; no registers used.

            5C   00000008'EF     D0  0051  1000 	MOVL	SAV_AP, AP		; restore AP to original arg list

                                     0058  1100 					; when LIB$INITIALIZE was called.

                          DB     11  0058  1200 	BRB	DISPATCH_CONT		; go continue dispatch loop

                                     005A  1300 

                                     005A  1400 	.END				; End of module LIB$INITIALIZE

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   7

SYMBOL TABLE                                                                                                                     (7)



BIT...         = 00000010            SF$V_Z         = 00000002            

CALL_MAIN        0000003E R     08   SF$W_SAVE_MASK   00000006            

CO_ROUT          0000004F R     08   SF$W_SAVE_PSW    00000004            

DISPATCH_CONT    00000035 R     08   START_ADR_ADR  = 00000004            

DISP_PTR         00000000 R     07   

FOR$K_ERR_PREFX= 00000018            

GBL...         = 00000000            

INIT_TABLE_BEG   00000000 R     03   

INIT_TABLE_END   00000000 R     06   

LIB$INITIALIZE   00000000 RG    08   

LOOP             00000021 R     08   

MTH$K_ERR_PREFX= 00000016            

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

RET              0000004E R     08   

SAV_AP           00000008 R     07   

SAV_START_ADR    00000004 R     07   

SF$A_HANDLER     00000000            

SF$L_SAVE_AP     00000008            

SF$L_SAVE_FP     0000000C            

SF$L_SAVE_PC     00000010            

SF$L_SAVE_REGS   00000014            

SF$M_C         = 00000001            

SF$M_DV        = 00000080            

SF$M_FU        = 00000040            

SF$M_IV        = 00000020            

SF$M_N         = 00000008            

SF$M_TBIT      = 00000010            

SF$M_V         = 00000002            

SF$M_Z         = 00000004            

SF$S_C         = 00000001            

SF$S_CALLS     = 00000001            

SF$S_DV        = 00000001            

SF$S_FU        = 00000001            

SF$S_IV        = 00000001            

SF$S_N         = 00000001            

SF$S_SAVE_MASK = 0000000C            

SF$S_STACKOFFS = 00000002            

SF$S_TBIT      = 00000001            

SF$S_V         = 00000001            

SF$S_Z         = 00000001            

SF$V_C         = 00000000            

SF$V_CALLS     = 0000000D            

SF$V_DV        = 00000007            

SF$V_FU        = 00000006            

SF$V_IV        = 00000005            

SF$V_N         = 00000003            

SF$V_SAVE_MASK = 00000000            

SF$V_STACKOFFS = 0000000E            

SF$V_TBIT      = 00000004            

SF$V_V         = 00000001            

LIB$INITIALIZE  ; Library initialization dispatcher              21-AUG-1978 18:58:23   VAX-11 MACRO X0.3-11               Page   8

PROGRAM SECTION SYNOPSIS                                                                                                         (7)







PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            00000018      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

LIB$INITIALIZDZ  00000000      03     NOPIC   USR   CON   REL   GBL NOSHR NOEXE   RD  NOWRT LONG  

LIB$INITIALIZD_  00000000      04     NOPIC   USR   CON   REL   GBL NOSHR NOEXE   RD  NOWRT LONG  

LIB$INITIALIZE   00000000      05     NOPIC   USR   CON   REL   GBL NOSHR NOEXE   RD  NOWRT LONG  

LIB$INITIALIZE$  00000004      06     NOPIC   USR   CON   REL   GBL NOSHR NOEXE   RD  NOWRT LONG  

LIB$DATA         0000000C      07       PIC   USR   CON   REL   LCL NOSHR NOEXE   RD    WRT BYTE  

LIB$CODE_NOSHR   0000005A      08       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

25498. BYTES LEFT IN FREE MEMORY POOL.

112. BYTES OF RECLAIMED MEMORY.

OBJ$:LIBINITIA,LIS$:LIBINITIA/-SP=LIB$:S/ML,SRC$:P,LIBINITIA

5 MLB DIR RDS - 106 GETS TO DEFINE 8 MACROS. 6 INTER. FILE WRITES. 

