prt0.as 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. / prt0.s (emx+fpk) -- Made from crt0.s,
  2. / Copyright (c) 1990-1999-2000 by Eberhard Mattes.
  3. / Changed for Free Pascal in 1997 Daniel Mantione.
  4. / This code is _not_ under the Library GNU Public
  5. / License, because the original is not. See copying.emx
  6. / for details. You should have received it with this
  7. / product, write the author if you haven't.
  8. .globl __text
  9. .globl ___SYSCALL
  10. .globl __data
  11. .globl __heap_base
  12. .globl __heap_brk
  13. .globl __heap_end
  14. .globl __init
  15. .text
  16. __text:
  17. push $__data
  18. call __dos_init
  19. jmp __init
  20. ___SYSCALL:
  21. call __dos_syscall
  22. ret
  23. .space 6, 0x90
  24. __init: cld
  25. call __entry1
  26. call _main
  27. movb $0x4c,%ah
  28. call ___SYSCALL
  29. 2: jmp 2b
  30. .data
  31. / The data segment starts with a table containing the start and end
  32. / addresses of the text, data and bss segments
  33. __data:
  34. .long __text
  35. .long __etext
  36. .long __data
  37. .long __edata
  38. .long __edata
  39. .long __end
  40. __heap_base:
  41. .long 0
  42. __heap_end:
  43. .long 0
  44. __heap_brk:
  45. .long 0
  46. .long 0
  47. .long __os2dll
  48. .long 0
  49. .long 0
  50. .long 0x02000000
  51. .long 0
  52. .long 0
  53. .byte 0
  54. .space 63, 0
  55. / Don't touch this. It's EMX vodoo. In short, this causes the __os2dll symbol
  56. / point to table of DLL data that the linker includes in the executable.
  57. .stabs "__os2dll", 21, 0, 0, 0xffffffff
  58. .stabs "___CTOR_LIST__", 21, 0, 0, 0xffffffff
  59. .stabs "___DTOR_LIST__", 21, 0, 0, 0xffffffff
  60. .stabs "___crtinit1__", 21, 0, 0, 0xffffffff
  61. .stabs "___crtexit1__", 21, 0, 0, 0xffffffff