prt0.as 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #
  2. # This file is part of the Free Pascal run time library.
  3. # Copyright (c) 2017 by Karoly Balogh
  4. # member of the Free Pascal development team.
  5. #
  6. # See the file COPYING.FPC, included in this distribution,
  7. # for details about the copyright.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY;without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. #
  13. #**********************************************************************}
  14. #
  15. # NetBSD standard (shared) ELF/arm startup code for Free Pascal
  16. # r12/ip = ps_strings on entry
  17. .section .text
  18. .globl _start
  19. _start:
  20. mov ip, r0
  21. mov r0, r2
  22. mov r2, ip
  23. ldr r3, [r2, #0]
  24. ldr r4, =operatingsystem_parameter_argv
  25. str r3, [r4]
  26. ldr r3, [r2, #4]
  27. ldr r4, =operatingsystem_parameter_argc
  28. str r3, [r4]
  29. ldr r3, [r2, #8]
  30. ldr r4, =operatingsystem_parameter_envp
  31. str r3, [r4]
  32. ldr r4, =environ
  33. str r3, [r4]
  34. # cache align, just in case
  35. bic sp, sp, #7
  36. bl PASCALMAIN
  37. bl _haltproc
  38. .globl _haltproc
  39. _haltproc:
  40. ldr r0,=operatingsystem_result
  41. ldr r0,[r0]
  42. svc 0xa00001
  43. .section .data
  44. .comm environ,4,4
  45. .comm operatingsystem_parameter_envp,4,4
  46. .comm operatingsystem_parameter_argc,4,4
  47. .comm operatingsystem_parameter_argv,4,4
  48. .section ".note.netbsd.ident", "a"
  49. .long 2f-1f
  50. .long 4f-3f
  51. .long 1
  52. 1: .asciz "NetBSD"
  53. 2: .p2align 2
  54. 3: .long 400000000
  55. 4: .p2align 2