~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to rtl/freebsd/i386/prt0.as

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
#   $Id: prt0.as,v 1.3 2000/11/07 14:07:19 marco Exp $
3
 
#   This file is part of the Free Pascal run time library.
4
 
#   Copyright (c) 1999-2000 by Marco van de Voort, Michael Van Canneyt
5
 
#                                                  and Peter Vreman
6
 
#   members of the Free Pascal development team.
7
 
#
8
 
#   See the file COPYING.FPC, included in this distribution,
9
 
#   for details about the copyright.
10
 
#
11
 
#   This program is distributed in the hope that it will be useful,
12
 
#   but WITHOUT ANY WARRANTY;without even the implied warranty of
13
 
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 
#
15
 
#**********************************************************************}
16
 
#
17
 
# FreeBSD standard (static) ELF startup code for Free Pascal
18
 
#
19
 
 
20
 
        .file   "prt1.as"
21
 
        .version        "01.01"
22
 
gcc2_compiled.:
23
 
.globl __progname
24
 
.section        .rodata
25
 
.LC0:
26
 
        .ascii "\0"
27
 
.data
28
 
        .p2align 2
29
 
        .type    __progname,@object
30
 
        .size    __progname,4
31
 
__progname:
32
 
        .long .LC0
33
 
        .align  4
34
 
___fpucw:
35
 
        .long   0x1332
36
 
 
37
 
        .globl  ___fpc_brk_addr         /* heap management */
38
 
        .type   ___fpc_brk_addr,@object
39
 
        .size   ___fpc_brk_addr,4
40
 
___fpc_brk_addr:
41
 
        .long   0
42
 
 
43
 
 
44
 
.text
45
 
        .p2align 2
46
 
.globl _start
47
 
        .type    _start,@function
48
 
_start:
49
 
        pushl %ebp
50
 
        movl %esp,%ebp
51
 
        pushl %edi
52
 
        pushl %esi
53
 
        pushl %ebx
54
 
#APP
55
 
        movl %edx,%edx
56
 
#NO_APP
57
 
        leal 8(%ebp),%edi
58
 
        movl %edi,U_SYSTEM_ARGV
59
 
        mov -4(%edi),%eax
60
 
        movl %eax,U_SYSTEM_ARGC
61
 
        movl 4(%ebp),%ebx
62
 
        leal 12(%ebp,%ebx,4),%esi
63
 
        movl %esi,U_SYSTEM_ENVP
64
 
        movl %esi,environ
65
 
        testl %ebx,%ebx
66
 
        jle .L2
67
 
        movl 8(%ebp),%eax
68
 
        testl %eax,%eax
69
 
        je .L2
70
 
        movl %eax,__progname
71
 
        cmpb $0,(%eax)
72
 
        je .L2
73
 
        .p2align 2,0x90
74
 
.L6:
75
 
        cmpb $47,(%eax)
76
 
        jne .L5
77
 
        leal 1(%eax),%ecx
78
 
        movl %ecx,__progname
79
 
.L5:
80
 
        incl %eax
81
 
        cmpb $0,(%eax)
82
 
        jne .L6
83
 
.L2:
84
 
.L9:
85
 
 
86
 
# copied from linux
87
 
 
88
 
        finit                           /* initialize fpu */
89
 
        fwait
90
 
        fldcw   ___fpucw
91
 
 
92
 
        xorl    %ebp,%ebp
93
 
 
94
 
        call main
95
 
        pushl %eax
96
 
        jmp   _haltproc
97
 
        
98
 
.p2align 2,0x90
99
 
.globl _haltproc
100
 
.type _haltproc,@function
101
 
 
102
 
_haltproc:
103
 
           mov $1,%eax  
104
 
           movzwl U_SYSTEM_EXITCODE,%ebx
105
 
           pushl %ebx
106
 
           call _actualsyscall
107
 
           addl  $4,%esp
108
 
           jmp   _haltproc
109
 
 
110
 
_actualsyscall:
111
 
         int $0x80
112
 
         jb .LErrorcode
113
 
         xor %ebx,%ebx
114
 
         ret
115
 
.LErrorcode:
116
 
         mov %eax,%ebx
117
 
         mov $-1,%eax
118
 
         ret
119
 
        .p2align 2,0x90
120
 
.Lfe1:
121
 
        .size    _start,.Lfe1-_start
122
 
        .comm   environ,4,4
123
 
        .weak   _DYNAMIC
124
 
        .ident  "GCC: (GNU) 2.7.2.1"