dllprt0.as 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .file "dllprt0.as"
  2. .text
  3. .globl _startlib
  4. .type _startlib,#function
  5. _startlib:
  6. .globl FPC_SHARED_LIB_START
  7. .type FPC_SHARED_LIB_START,#function
  8. FPC_SHARED_LIB_START:
  9. mov ip, sp
  10. stmfd sp!,{fp, ip, lr, pc}
  11. sub fp, ip, #4
  12. /* a1 contains argc, a2 contains argv and a3 contains envp */
  13. ldr ip, =operatingsystem_parameter_argc
  14. str a1, [ip]
  15. ldr ip, =operatingsystem_parameter_argv
  16. str a2, [ip]
  17. ldr ip, =operatingsystem_parameter_envp
  18. str a3, [ip]
  19. /* save initial stackpointer */
  20. ldr ip, =__stklen
  21. str sp, [ip]
  22. ldr ip, =TC_SYSTEM_ISLIBRARY
  23. mov a1, #1
  24. str a1, [ip]
  25. /* call main and exit normally */
  26. bl PASCALMAIN
  27. ldmdb fp, {fp, sp, pc}
  28. .globl _haltproc
  29. .type _haltproc,#function
  30. _haltproc:
  31. /* r0 contains exitcode */
  32. swi 0x900001
  33. b _haltproc
  34. .globl _haltproc_eabi
  35. .type _haltproc_eabi,#function
  36. _haltproc_eabi:
  37. /* r0 contains exitcode */
  38. mov r7,#248
  39. swi 0x0
  40. b _haltproc_eabi
  41. .data
  42. .type operatingsystem_parameters,#object
  43. .size operatingsystem_parameters,12
  44. operatingsystem_parameters:
  45. .skip 3*4
  46. .global operatingsystem_parameter_envp
  47. .global operatingsystem_parameter_argc
  48. .global operatingsystem_parameter_argv
  49. .set operatingsystem_parameter_envp,operatingsystem_parameters+0
  50. .set operatingsystem_parameter_argc,operatingsystem_parameters+4
  51. .set operatingsystem_parameter_argv,operatingsystem_parameters+8
  52. .bss
  53. .comm __stkptr,4