1 /* Startup code for M68HC11.
2 Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
4 This file is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
9 In addition to the permissions in the GNU General Public License, the
10 Free Software Foundation gives you unlimited permission to link the
11 compiled version of this file with other programs, and to distribute
12 those programs without any restriction coming from the use of this
13 file. (The General Public License restrictions do apply in other
14 respects; for example, they cover modification of the file, and
15 distribution when not linked into another program.)
17 This file is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; see the file COPYING. If not, write to
24 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
25 Boston, MA 02110-1301, USA. */
27 /* As a special exception, if you link this library with other files,
28 some of which are compiled with GCC, to produce an executable,
29 this library does not by itself cause the resulting executable
30 to be covered by the GNU General Public License.
31 This exception does not however invalidate any other reasons why
32 the executable file might be covered by the GNU General Public License. */
34 ;-----------------------------------------
36 ;-----------------------------------------
39 #ifdef __HAVE_SHORT_INT__
45 #if defined(__USE_RTC__) && defined(mc68hc12)
52 ;; The linker concatenate the .install* sections in the following order:
54 ;; .install0 Setup the stack pointer
55 ;; .install1 Place holder for applications
56 ;; .install2 Optional installation of data section in memory
57 ;; .install3 Place holder for applications
58 ;; .install4 Invokes the main
60 .sect .install0,"ax",@progbits
65 ;; At this step, the stack is not initialized and interrupts are masked.
66 ;; Applications only have 64 cycles to initialize some registers.
68 ;; To have a generic/configurable startup, initialize the stack to
69 ;; the end of some memory region. The _stack symbol is defined by
74 .sect .install2,"ax",@progbits
76 ;; Call a specific initialization operation. The default is empty.
77 ;; It can be overridden by applications. It is intended to initialize
78 ;; the 68hc11 registers. Function prototype is:
80 ;; int __premain(void);
87 .sect .install4,"ax",@progbits
93 ;-----------------------------------------
95 ;-----------------------------------------
96 ;; Force loading of data section mapping and bss clear
97 .2byte __map_data_section
98 .2byte __init_bss_section