]> gcc.gnu.org Git - gcc.git/blame - gcc/config/m68k/mot3300-crt0.S
Initial revision
[gcc.git] / gcc / config / m68k / mot3300-crt0.S
CommitLineData
ad8445f4
RK
1/* The start module crt0.s for the SysV68 Motorola 3300 Delta Series.
2 Copyright (C) 1996 Free Software Foundation, Inc.
3 Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de).
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING. If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA. */
21
22#ifdef MOTOROLA
23# define COMM comm
24# define DATA data
25# define EVEN even
26# define FILE(n) file n
27# define GLOBAL_SYM(s) global s
28# define LOCAL_LABEL(l) L%##l
29# define SECTION(n) section n
30# define TEXT text
31#else /* Assume we are using GNU as. */
32# define COMM .comm
33# define DATA .data
34# define EVEN .even
35# define FILE(name) .file name
36# define GLOBAL_SYM(s) .globl s
37# define LOCAL_LABEL(l) .L.##l
38# define SECTION(n) .section n
39# define STRING(s) .asciz s
40# define TEXT .text
41#endif
42
43 FILE ("crt0.s")
44 TEXT
45 GLOBAL_SYM (_start)
46_start: mov.l %d0,splimit%
47 subq.w &8,%sp
48 mov.l 8(%sp),(%sp)
49 lea 12(%sp),%a0
50 mov.l %a0,4(%sp)
51 mov.l %a0,%a1
52LOCAL_LABEL(0):
53 tst.l (%a0)+
54 bne.b LOCAL_LABEL(0)
55#ifdef SGS_CMP_ORDER
56 cmpa.l %a0,(%a1)
57#else
58 cmpa.l (%a1),%a0
59#endif
60 blt.b LOCAL_LABEL(1)
61 subq.w &4,%a0
62LOCAL_LABEL(1):
63 mov.l %a0,8(%sp)
64 mov.l %a0,environ
65 jsr initfpu
66
67 subq.w &8,%sp
68 clr.l %d0 /* if (! isatty (fileno (stderr))) */
69 mov.b _iob+27,%d0
70 mov.l %d0,-(%sp)
71 jsr isatty
72 addq.w &4,%sp
73 tst.l %d0
74 bne.b LOCAL_LABEL(isatty)
75 clr.l -(%sp) /* setbuf (stderr, NULL) */
76 pea _iob+28
77 jsr setbuf
78 addq.w &8,%sp
79LOCAL_LABEL(isatty):
80 addq.w &8,%sp
81
82 jsr main
83 mov.l %d0,(%sp)
84 jsr exit
85 moveq.l &1,%d0
86 trap &0
87 nop
88
89 EVEN
90
91 COMM splimit%,4
92 COMM environ,4
93
94 COMM mcount,4
95 COMM mcount%,4
96 COMM monitor,4
97
98#ifdef STRING
99 SECTION (.comment)
861bb6c1 100 STRING ("$Id: mot3300-crt0.S,v 1.1 1997/08/11 15:57:32 law Exp $\n")
ad8445f4
RK
101 STRING ("Contributed by manfred@lts.sel.alcatel.de (Manfred Hollstein, Germany)\n")
102#else
103 byte 'C,'o,'n,'t,'r,'i,'b,'u,'t,'e,'d,' ,'b,'y
104 byte ' ,'m,'a,'n,'f,'r,'e,'d,'@,'l,'t,'s,'.,'s
105 byte 'e,'l,'.,'a,'l,'c,'a,'t,'e,'l,'.,'d,'e,'
106 byte '(,'M,'a,'n,'f,'r,'e,'d,' ,'H,'o,'l,'l,'s
107 byte 't,'e,'i,'n,',,' ,'G,'e,'r,'m,'a,'n,'y,')
108 byte 10,0
109#endif
This page took 0.117693 seconds and 5 git commands to generate.