/ dll0.s (emx+gcc) -- Copyright (c) 1992-1998 by Eberhard Mattes

        .globl  __text
        .globl  ___syscall
        .globl  __data
        .globl  __heap_base
        .globl  __heap_brk
        .globl  __heap_end
        .globl  __init

        .text

__text:
        push    $__data
#if defined (OMF)
        call    __emx_init
#else
        call    __dos_init
#endif
        jmp     __init


___syscall:
#if defined (OMF)
        call    __emx_syscall
#else
        call    __dos_syscall
#endif
        ret

__init: cld
        pushl   %ebp
        movl    %esp, %ebp
        pushl   12(%ebp)
        pushl   8(%ebp)
        call    __DLL_InitTerm
        addl    $8, %esp
        popl    %ebp
        ret

        .data

/ The data segment starts with a table containing the start and end
/ addresses of the text, data and bss segments

__data:
        .long   __text
        .long   __etext
        .long   __data
        .long   __edata
        .long   __edata
        .long   __end
__heap_base:
        .long   0                       /* heap base address */
__heap_end:
        .long   0                       /* heap end address */
__heap_brk:
        .long   0                       /* heap brk address */
        .long   0                       /* heap offset */
        .long   __os2dll                /* list of OS/2 DLL references */
        .long   0                       /* stack base address */
        .long   0                       /* stack end address */
#if defined (OMF)
        .long   0x02000003              /* flags: DLL, OMF */
#else
        .long   0x02000001              /* flags: DLL */
#endif
        .long   0                       /* reserved */
        .long   0                       /* reserved */
        .byte   0                       /* options */
        .space  63, 0

/ first element of vector (N_SETA|N_EXT == 21)

#if defined (OMF)
__os2dll:
        .long   0, 0
#else
        .stabs  "__os2dll", 21, 0, 0, 0xffffffff
#endif

        .stabs  "___CTOR_LIST__", 21, 0, 0, 0xffffffff
        .stabs  "___DTOR_LIST__", 21, 0, 0, 0xffffffff
        .stabs  "___crtinit1__", 21, 0, 0, 0xffffffff
        .stabs  "___crtexit1__", 21, 0, 0, 0xffffffff
        .stabs  "___eh_frame__", 21, 0, 0, 0xffffffff
