
; Storm C Shared Library Startupcode

; Copyright 1996 HAAGE & PARTNER Computer GmbH

; This file contains only the tables for InitResident() and a definition of
; _SysBase (initialization is usually done by LibInit())

; The main work is done in storm.lib, there you find LibInit(),
; LibOpen(), LibClose(), LibExpunge() and LibNull() and you can simply
; override these (to support AREXX in LibNull for example).

LINKSYS	MACRO
	move.l a6,-(sp)
	move.l \2,a6
	jsr _LVO\1(a6)
	move.l (sp)+,a6
	ENDM

CALLSYS	MACRO
	JSR _LVO\1(a6)
	ENDM


	INCDIR WORK:ASM_Includes

	INCLUDE exec/initializers.i
	INCLUDE exec/libraries.i
	INCLUDE exec/resident.i

	XDEF _SysBase

	XREF _ThisLibraryName
	XREF __LIBRARYJUMPTABLE
	XREF _LibNameString
	XREF _LibVersionString
	XREF __VERSION
	XREF __REVISION
	XREF _LibInit

	XREF __THISSHAREDLIBRARYBASESIZE

	TTL "COMMON"

; Header

Start
	moveq #-1,d0
	rts

RomTag
	DC.W RTC_MATCHWORD
	DC.L RomTag
	DC.L EndCode
	DC.B RTF_AUTOINIT
	DC.B __VERSION
	DC.B NT_LIBRARY
	DC.B 0
	DC.L _LibNameString
	DC.L _LibVersionString
	DC.L InitTable

	CNOP 0,2

InitTable
	DC.L __THISSHAREDLIBRARYBASESIZE
	DC.L __LIBRARYJUMPTABLE
	DC.L DataTable
	DC.L _LibInit

DataTable
	INITBYTE LN_TYPE,NT_LIBRARY
	INITLONG LN_NAME,_LibNameString
	INITBYTE LIB_FLAGS,LIBF_SUMUSED|LIBF_CHANGED
	INITWORD LIB_VERSION,__VERSION
	INITWORD LIB_REVISION,__REVISION
	INITLONG LIB_IDSTRING,_LibVersionString
	DC.L 0

EndCode

	SECTION "libstartupd",DATA

_SysBase
	dc.l 0

	END
