prt0.as 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. / prt0.s (emx+fpk) -- Made from crt0.s,
  2. / Copyright (c) 1990-1994 by Eberhard Mattes.
  3. / Portions Copyright (c) 1997 Dani‰l Mantione.
  4. .globl __text
  5. .globl ___syscall
  6. .globl __data
  7. .globl __heap_base
  8. .globl __heap_brk
  9. .globl __heap_end
  10. .globl __init
  11. .text
  12. __text:
  13. push $__data
  14. call __dos_init
  15. jmp __init
  16. ___syscall:
  17. call __dos_syscall
  18. ret
  19. .space 6, 0x90
  20. __init: cld
  21. call __entry1
  22. call _main
  23. movb $0x4c,%ah
  24. call ___syscall
  25. 2: jmp 2b
  26. .data
  27. / The data segment starts with a table containing the start and end
  28. / addresses of the text, data and bss segments
  29. __data:
  30. .long __text
  31. .long __etext
  32. .long __data
  33. .long __edata
  34. .long __edata
  35. .long __end
  36. __heap_base:
  37. .long 0
  38. __heap_end:
  39. .long 0
  40. __heap_brk:
  41. .long 0
  42. .long 0
  43. .long __os2dll
  44. .long 0
  45. .long 0
  46. .long 0x02000000
  47. .long 0
  48. .long 0
  49. .byte 0
  50. .space 63, 0
  51. / Don't touch this. It's EMX vodoo. In short, this causes the __os2dll symbol
  52. / point to table of DLL data that the linker includes in the executable.
  53. .stabs "__os2dll", 21, 0, 0, 0xffffffff
  54. .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff
  55. .stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
  56. .stabs "___crtinit1__", 21, 0, 0, 0xffffffff
  57. .stabs "___crtexit1__", 21, 0, 0, 0xffffffff