prt0.as 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. .section .text
  17. .globl _start
  18. _start:
  19. # move.l %a2,-(%sp) | ps_strings
  20. # move.l %a0,-(%sp) | obj
  21. # move.l %a1,-(%sp) | cleanup
  22. # move.l 0(%a2),operatingsystem_parameter_argv
  23. # move.l 4(%a2),operatingsystem_parameter_argc
  24. # move.l 8(%a2),operatingsystem_parameter_envp
  25. # move.l 8(%a2),environ
  26. # jsr PASCALMAIN
  27. # jmp _haltproc
  28. .globl _haltproc
  29. _haltproc:
  30. # move.l operatingsystem_result,-(%sp)
  31. # move.l #0,-(%sp)
  32. # moveq.l #1,%d0
  33. # trap #0
  34. # rts
  35. .section .data
  36. .comm environ,4,4
  37. .comm operatingsystem_parameter_envp,4,4
  38. .comm operatingsystem_parameter_argc,4,4
  39. .comm operatingsystem_parameter_argv,4,4
  40. .section ".note.netbsd.ident", "a"
  41. .long 2f-1f
  42. .long 4f-3f
  43. .long 1
  44. 1: .asciz "NetBSD"
  45. 2: .p2align 2
  46. 3: .long 400000000
  47. 4: .p2align 2