home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / EMXFIX04.ZIP / DLL0.S < prev    next >
Text File  |  1994-01-17  |  3KB  |  107 lines

  1. / dll0.s (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes
  2.  
  3. / We're linking emxlibc.dll with dll0.obj, therefore we don't need
  4. / this module in emxlibc.dll
  5. #if !defined (_LIBCDLL)
  6.  
  7.         .globl  __text
  8.         .globl  ___syscall
  9.         .globl  __data
  10.         .globl  __heap_base
  11.         .globl  __heap_brk
  12.         .globl  __heap_end
  13.         .globl  __init
  14.         .globl  __osmode
  15.  
  16.         .text
  17.  
  18. __text:
  19.         push    $__data
  20. #if defined (OMF)
  21.         call    Ldummy
  22. #else
  23.         call    __dos_init
  24. #endif
  25.         jmp     __init
  26.  
  27.  
  28. ___syscall:
  29. #if defined (OMF)
  30.         call    _emx_syscall
  31. #else
  32.         call    __dos_syscall
  33. #endif
  34.         ret
  35.  
  36. Ldummy: popl    %eax
  37.         add     $4, %esp
  38.         jmp     %eax
  39.  
  40. __init: cld
  41.         pushl   %ebp
  42.         movl    %esp, %ebp
  43.         pushl   12(%ebp)
  44.         pushl   8(%ebp)
  45.         call    __DLL_InitTerm
  46.         addl    $8, %esp
  47.         popl    %ebp
  48.         ret
  49.  
  50.         .data
  51.  
  52. / The data segment starts with a table containing the start and end
  53. / addresses of the text, data and bss segments
  54.  
  55. __data:
  56. #if defined (OMF)
  57.         .long   0
  58.         .long   0
  59.         .long   0
  60.         .long   0
  61.         .long   0
  62.         .long   0
  63. #else
  64.         .long   __text
  65.         .long   __etext
  66.         .long   __data
  67.         .long   __edata
  68.         .long   __edata
  69.         .long   __end
  70. #endif
  71. __heap_base:
  72.         .long   0                       / heap base address
  73. __heap_end:
  74.         .long   0                       / heap end address
  75. __heap_brk:
  76.         .long   0                       / heap brk address
  77.         .long   0                       / heap offset
  78.         .long   __os2dll                / list of OS/2 DLL references
  79.         .long   0                       / stack base address
  80.         .long   0                       / stack end address
  81. #if defined (OMF)
  82.         .long   0x01000003              / flags: DLL, OMF
  83. #else
  84.         .long   0x01000001              / flags: DLL
  85. #endif
  86.         .long   0                       / reserved
  87.         .long   0                       / reserved
  88.         .byte   0                       / options
  89.         .space  63, 0
  90.  
  91. / first element of vector (N_SETA|N_EXT == 21)
  92.  
  93. #if defined (OMF)
  94. __os2dll:
  95.         .long   0, 0
  96. #else
  97.         .stabs  "__os2dll", 21, 0, 0, 0xffffffff
  98. #endif
  99.  
  100.         .stabs  "___CTOR_LIST__", 21, 0, 0, 0xffffffff
  101.         .stabs  "___DTOR_LIST__", 21, 0, 0, 0xffffffff
  102.  
  103. __osmode:
  104.         .byte   1                       / OS2_MODE
  105.  
  106. #endif
  107.