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 IDENT(s) ident s 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 IDENT(s) .section .comment;.asciz s 39# define TEXT .text 40#endif 41 42 FILE ("crt0.s") 43 TEXT 44 GLOBAL_SYM (_start) 45_start: mov.l %d0,splimit% 46 subq.w &8,%sp 47 mov.l 8(%sp),(%sp) 48 lea 12(%sp),%a0 49 mov.l %a0,4(%sp) 50 mov.l %a0,%a1 51LOCAL_LABEL(0): 52 tst.l (%a0)+ 53 bne.b LOCAL_LABEL(0) 54#ifdef SGS_CMP_ORDER 55 cmpa.l %a0,(%a1) 56#else 57 cmpa.l (%a1),%a0 58#endif 59 blt.b LOCAL_LABEL(1) 60 subq.w &4,%a0 61LOCAL_LABEL(1): 62 mov.l %a0,8(%sp) 63 mov.l %a0,environ 64 jsr initfpu 65 66 subq.w &8,%sp 67 clr.l %d0 /* if (! isatty (fileno (stderr))) */ 68 mov.b _iob+27,%d0 69 mov.l %d0,-(%sp) 70 jsr isatty 71 addq.w &4,%sp 72 tst.l %d0 73 bne.b LOCAL_LABEL(isatty) 74 clr.l -(%sp) /* setbuf (stderr, NULL) */ 75 pea _iob+28 76 jsr setbuf 77 addq.w &8,%sp 78LOCAL_LABEL(isatty): 79 addq.w &8,%sp 80 81 jsr main 82 mov.l %d0,(%sp) 83 jsr exit 84 moveq.l &1,%d0 85 trap &0 86 nop 87 88 GLOBAL_SYM (__stop_monitor) 89__stop_monitor: 90 rts 91 EVEN 92 93 COMM splimit%,4 94 COMM environ,4 95 96 IDENT ("$Id: mot3300-crt0.S,v 1.1.1.1 2003/11/29 12:33:38 espie Exp $") 97 IDENT ("Contributed by Manfred Hollstein (manfred@lts.sel.alcatel.de)") 98 IDENT ("Corrections by Philippe De Muyter (phdm@macqel.be)") 99