wdllprt0.as 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // DLL Startup code for WIN32 port of Free Pascal
  2. // Written by P.Ozerski 16.10.1998
  3. .text
  4. .globl _mainCRTStartup
  5. _mainCRTStartup:
  6. movb $1,U_SYSTEM_ISCONSOLE
  7. jmp .LDLL_Entry
  8. .globl _WinMainCRTStartup
  9. _WinMainCRTStartup:
  10. movb $0,U_SYSTEM_ISCONSOLE
  11. .LDLL_Entry:
  12. pushl %ebp
  13. movl %esp,%ebp
  14. pushl %ebx
  15. pushl %esi
  16. pushl %edi
  17. movl 8(%ebp),%edi
  18. movl %edi,SysInstance
  19. movl 12(%ebp),%edi
  20. movl %edi,U_SYSTEM_DLLREASON
  21. movl 16(%ebp),%edi
  22. movl %edi,U_SYSTEM_DLLPARAM
  23. movl %esp,__stkptr
  24. call _FPC_DLL_Entry
  25. popl %edi
  26. popl %esi
  27. popl %ebx
  28. popl %ebp
  29. ret $12
  30. .globl asm_exit
  31. asm_exit:
  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"
  64. .bss
  65. .comm __stkptr,4