gprt0.as 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //Startup code for WIN32 port of Free Pascal
  2. //Written by P.Ozerski 1998
  3. // modified by Pierre Muller
  4. .text
  5. .globl _mainCRTStartup
  6. _mainCRTStartup:
  7. movb $1,U_SYSTEM_ISCONSOLE
  8. jmp _start
  9. .globl _WinMainCRTStartup
  10. _WinMainCRTStartup:
  11. movb $0,U_SYSTEM_ISCONSOLE
  12. _start:
  13. subl $0x8,%esp
  14. andl $0xfffffff0,%esp
  15. push $_cmain
  16. call _cygwin_crt0
  17. .globl _cmain
  18. _cmain:
  19. subl $0x8,%esp
  20. andl $0xfffffff0,%esp
  21. pushl etext
  22. pushl __image_base__
  23. call _monstartup
  24. call ___main
  25. call _FPC_EXE_Entry
  26. ret
  27. .globl asm_exit
  28. asm_exit:
  29. pushl %eax
  30. call __mcleanup
  31. popl %eax
  32. pushl %eax
  33. call exitprocess
  34. .text
  35. .globl exitprocess
  36. exitprocess:
  37. jmp *.L10
  38. .balign 4,144
  39. .text
  40. .balign 4,144
  41. .section .idata$2
  42. .rva .L7
  43. .long 0,0
  44. .rva .L6
  45. .rva .L8
  46. .section .idata$4
  47. .L7:
  48. .rva .L9
  49. .long 0
  50. .section .idata$5
  51. .L8:
  52. .section .idata$5
  53. .L10:
  54. .rva .L9
  55. .long 0
  56. .section .idata$6
  57. .L9:
  58. .short 0
  59. .ascii "ExitProcess\000"
  60. .balign 2,0
  61. .section .idata$7
  62. .L6:
  63. .ascii "kernel32.dll\000"