prt0.as 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Startup code for WinCE port of Free Pascal
  3. Written by Yury Sidorov, 2005.
  4. */
  5. .section .text
  6. @ for kernel exception handler, must be directly before ___EH_CODE_START__
  7. __EH_HANDLER__:
  8. .word _ARM_ExceptionHandler
  9. .word 0
  10. __EH_CODE_START__:
  11. .globl mainCRTStartup
  12. mainCRTStartup:
  13. .globl _mainCRTStartup
  14. _mainCRTStartup:
  15. mov r0,#1
  16. b do_start
  17. .globl WinMainCRTStartup
  18. WinMainCRTStartup:
  19. .globl _WinMainCRTStartup
  20. _WinMainCRTStartup:
  21. mov r0,#0
  22. do_start:
  23. ldr r1, _PISCONSOLE
  24. strb r0,[r1]
  25. bl _FPC_EXE_Entry
  26. mov r0,#0
  27. .globl asm_exit
  28. asm_exit:
  29. bl exitthread
  30. _PISCONSOLE:
  31. .long U_SYSTEM_ISCONSOLE
  32. .globl exitthread
  33. exitthread:
  34. ldr ip,.L100
  35. ldr pc,[ip]
  36. .L100:
  37. .long .L10
  38. .section .idata$2
  39. .rva .L7
  40. .long 0,0
  41. .rva .L6
  42. .rva .L8
  43. .section .idata$4
  44. .L7:
  45. .rva .L9
  46. .long 0
  47. .section .idata$5
  48. .L8:
  49. .section .idata$5
  50. .L10:
  51. .rva .L9
  52. .long 0
  53. .section .idata$6
  54. .L9:
  55. .short 0
  56. .ascii "ExitThread\000"
  57. .balign 2,0
  58. .section .idata$7
  59. .L6:
  60. .ascii "coredll.dll\000"
  61. @ for kernel exception handler
  62. .section .pdata
  63. .word __EH_CODE_START__
  64. @ max 22 bits for number of instructions
  65. .word 0xc0000002 | (0xFFFFF << 8)