
	    ;   TAG.ASM
	    ;
	    ;   Library tag.  This replaces the normal startup code, c.o,
	    ;   but still must perform certain startup functions such as
	    ;   the clearing of BSS and small-data model setup & auto
	    ;   calls.  HOWEVER, we do not include any resident startup
	    ;   code meaning you CANNOT compile the shared library -r
	    ;   (which doesn't make sense to do anyway).
	    ;
	    ;   Further, no C startup or exit functions are included
	    ;   since this is a library, not a normal program.  Refer
	    ;   to the source code LIB/AMIGA/C.A for a fully operational
	    ;   startup module.

;Prototype ALibExpunge(), ALibClose(), ALibOpen(), ALibReserved();

	    section text,code

	    xref    @LibInit
	    xref    @LibOpen
	    xref    @LibClose
	    xref    @LibExpunge

	    xdef    _ALibOpen
	    xdef    _ALibClose
	    xdef    _ALibExpunge
	    xdef    _ALibReserved

	    xref    __BSS_LEN           ; (dlink), length of BSS
	    xref    __DATA_BAS          ; (dlink), base of initialized data
	    xref    __DATA_LEN          ; (dlink), length of data


	    xdef    _LibId
	    xdef    _LibName

	    moveq   #20,D0
	    rts

InitDesc:   dc.w    $4AFC       ;RTC_MATCHWORD
	    dc.l    InitDesc    ;Pointer to beginning
	    dc.l    EndCode     ;Note sure it matters
	    dc.b    0           ;flags (NO RTF_AUTOINIT)
	    dc.b    37          ;version
	    dc.b    9           ;NT_LIBRARY
	    dc.b    0           ;priority (doesn't matter)
	    dc.l    _LibName    ;Name of library
	    dc.l    _LibId      ;ID string (note CR-LF at end)
	    dc.l    @LibInit    ;Pointer to init routine

_LibName:   dc.b    'C.generator',0
_LibId:     dc.b    'C.generator 37.5 (9.5.96)',13,10,0
	    ds.w    0
EndCode:

	    ;   Assembly tags for other functions, assume a registered
	    ;   C entry point

_ALibOpen
	    move.l  A6,A0
	    jmp     @LibOpen(pc)

_ALibClose
	    move.l  A6,A0
	    jmp     @LibClose(pc)

_ALibExpunge
	    move.l  A6,A0
	    jmp     @LibExpunge(pc)

_ALibReserved
	    moveq.l #0,D0
	    rts


	    END

