cprt0.as 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. |
  2. | $Id: cprt0.as,v 1.1.2.2 2001/08/01 13:26:17 pierre Exp $
  3. | This file is part of the Free Pascal run time library.
  4. | Copyright (c) 2001 by Free Pascal Core 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. | Linux m68k ELF startup code for linking with C lib for Free Pascal
  16. |
  17. .file "cprt0.as"
  18. .text
  19. .globl _start
  20. .type _start,@function
  21. _start:
  22. .globl __entry
  23. .type __entry,@function
  24. __entry:
  25. move.l 8(%sp),%d0
  26. move.l %d0,U_SYSLINUX_ENVP
  27. move.l %d0,__environ
  28. move.l 4(%sp),%d0
  29. move.l %d0,U_SYSLINUX_ARGV
  30. move.l (%sp),%d0
  31. move.l %d0,U_SYSLINUX_ARGC
  32. | The arguments should be in correct order for
  33. | calling __libc_init
  34. | This code is untested for now PM
  35. jsr __libc_init
  36. | insert _fini in atexit chain
  37. move.l _fini,-(%sp)
  38. jsr atexit
  39. addq.l #4,%sp
  40. | call _init function
  41. jsr _init
  42. jsr PASCALMAIN
  43. | Used by System_exit procedure
  44. .globl _haltproc
  45. _haltproc:
  46. | Call C exit function
  47. move.w U_SYSLINUX_EXITCODE,%d1
  48. move.l %d1,-(%sp)
  49. jsr exit
  50. moveq.l #1,%d0
  51. move.l (%sp)+,%d1
  52. trap #0
  53. bra _haltproc
  54. | Is this still needed ??
  55. | .data
  56. | .align 4
  57. | .globl ___fpc_brk_addr
  58. |___fpc_brk_addr:
  59. | .long 0
  60. |
  61. | $Log: cprt0.as,v $
  62. | Revision 1.1.2.2 2001/08/01 13:26:17 pierre
  63. | * syntax adapted to GNU as
  64. |
  65. | Revision 1.1.2.1 2001/07/13 15:29:32 pierre
  66. | first version of cprt0.as
  67. |
  68. |