~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to rtl/morphos/prt0.as

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  $Id: prt0.as,v 1.7 2004/05/13 01:15:42 karoly Exp $
 
3
*/
 
4
/*
 
5
   This file is part of the Free Pascal run time library.
 
6
   Copyright (c) 2004 by Karoly Balogh for Genesi Sarl. 
 
7
 
 
8
   Thanks for Martin 'MarK' Kuchinka <kuchinka@volny.cz>
 
9
   for his help.
 
10
 
 
11
   See the file COPYING.FPC, included in this distribution,
 
12
   for details about the copyright.
 
13
 
 
14
   This program is distributed in the hope that it will be useful,
 
15
   but WITHOUT ANY WARRANTY;without even the implied warranty of
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
17
*/
 
18
        .section        ".text"
 
19
        .globl  _start
 
20
        .align  4
 
21
_start:
 
22
        stwu 1,-64(1)
 
23
        mflr 0
 
24
        stw 29,52(1)
 
25
        stw 30,56(1)
 
26
        stw 31,60(1)
 
27
        stw 0,68(1)
 
28
 
 
29
        /* Save Stackpointer */
 
30
        lis 4,OriginalStkPtr@ha
 
31
        stw 1,OriginalStkPtr@l(4)
 
32
 
 
33
        /* Get ExecBase */
 
34
        lwz 3,4(0)
 
35
        lis 4,_ExecBase@ha
 
36
        stw 3,_ExecBase@l(4)
 
37
 
 
38
        bl      PASCALMAIN
 
39
 
 
40
        .globl  _haltproc
 
41
_haltproc:
 
42
        /* Restore Stackpointer */      
 
43
        lis 4,OriginalStkPtr@ha
 
44
        lwz 1,OriginalStkPtr@l(4)
 
45
 
 
46
        lwz 11,0(1)
 
47
        lwz 0,4(11)
 
48
        mtlr 0
 
49
        lwz 29,-12(11)
 
50
        lwz 30,-8(11)
 
51
        lwz 31,-4(11)
 
52
        mr 1,11
 
53
        blr
 
54
 
 
55
        .globl  _ExecBase
 
56
        .globl  SysBase
 
57
        .align  4
 
58
SysBase:
 
59
_ExecBase:
 
60
        .long   0
 
61
 
 
62
   .globl       OriginalStkPtr
 
63
        .align  4
 
64
OriginalStkPtr:
 
65
        .long   0
 
66
 
 
67
        /* This is needed to be a proper MOS ABox executable */
 
68
        /* This symbol _MUST NOT_ be stripped out from the executable */
 
69
   /* or else... */
 
70
        .globl  __abox__
 
71
        .type    __abox__,@object
 
72
        .size    __abox__,4
 
73
__abox__:
 
74
        .long 1
 
75
 
 
76
/*
 
77
  $Log: prt0.as,v $
 
78
  Revision 1.7  2004/05/13 01:15:42  karoly
 
79
    - removed comment about argc/argv, made it work another way
 
80
 
 
81
  Revision 1.6  2004/05/01 15:08:57  karoly
 
82
    + haltproc added, saving/restoring stackpointer added
 
83
 
 
84
  Revision 1.5  2004/04/21 03:24:55  karoly
 
85
   * rewritten to be similar to GCC startup code
 
86
 
 
87
  Revision 1.4  2004/04/09 04:02:43  karoly
 
88
   * abox id symbol fixed
 
89
 
 
90
  Revision 1.3  2004/04/09 02:58:15  karoly
 
91
   * typo fixed.
 
92
 
 
93
  Revision 1.1  2004/03/16 10:29:22  karoly
 
94
   * first implementation of some startup code for MOS
 
95
 
 
96
*/