2
0

prt0.as 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # $Id$
  3. # This file is part of the Free Pascal run time library.
  4. # Copyright (c) 1996-98 by Michael Van Canneyt
  5. # member of the Free Pascal development team.
  6. #
  7. # See the file COPYING.FPC, included in this distribution,
  8. # for details about the copyright.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY;without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. #**********************************************************************}
  15. #
  16. # Linux a.out startup code for Free Pascal
  17. #
  18. .file "prt0.as"
  19. .text
  20. .globl __entry
  21. __entry:
  22. movl 8(%esp),%eax /* Move the environment pointer */
  23. movl 4(%esp),%ebx /* Move the argument pointer */
  24. movl (%esp),%ecx /* Move the argument counter */
  25. movl %eax,U_SYSLINUX_ENVP
  26. movl %ebx,U_SYSLINUX_ARGV
  27. movl %ecx,U_SYSLINUX_ARGC
  28. finit /* initialize fpu */
  29. fwait
  30. fldcw ___fpucw
  31. xorl %ebp,%ebp
  32. call PASCALMAIN
  33. .globl _haltproc
  34. .type _haltproc,@function
  35. _haltproc:
  36. movl $1,%eax /* exit call */
  37. xorl %ebx,%ebx
  38. movw U_SYSLINUX_EXITCODE,%bx
  39. int $0x80
  40. jmp _haltproc
  41. .data
  42. .align 4
  43. ___fpucw:
  44. .long 0x1332
  45. .globl ___fpc_brk_addr /* heap management */
  46. .type ___fpc_brk_addr,@object
  47. .size ___fpc_brk_addr,4
  48. ___fpc_brk_addr:
  49. .long 0
  50. #
  51. # $Log$
  52. # Revision 1.5 1998-11-04 10:16:28 peter
  53. # + xorl ebp,ebp to indicate end of backtrace
  54. #
  55. # Revision 1.4 1998/10/14 21:28:49 peter
  56. # * initialize fpu so sigfpe is finally generated for fpu errors
  57. #
  58. # Revision 1.3 1998/08/08 14:42:11 peter
  59. # * added missing ___fpc_sbrk and logs
  60. #
  61. #