~ubuntu-branches/ubuntu/raring/avr-libc/raring-proposed

« back to all changes in this revision

Viewing changes to crt1/gcrt1.S

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2007-12-29 16:20:03 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20071229162003-xx0w1lyakuvfwrhm
Tags: upstream-1.4.7
ImportĀ upstreamĀ versionĀ 1.4.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (c) 2002, Marek Michalkiewicz <marekm@amelek.gda.pl>
 
2
   Copyright (c) 2007, Eric B. Weddington
2
3
   All rights reserved.
3
4
 
4
5
   Redistribution and use in source and binary forms, with or without
28
29
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
30
   POSSIBILITY OF SUCH DAMAGE. */
30
31
 
31
 
/* $Id: gcrt1.S,v 1.8.2.1 2007/05/08 20:58:39 joerg_wunsch Exp $ */
 
32
/* $Id: gcrt1.S,v 1.8.2.4 2007/10/23 13:34:54 joerg_wunsch Exp $ */
32
33
 
33
34
#if (__GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
34
35
#error "GCC version >= 3.3 required"
142
143
 
143
144
        .section .init2,"ax",@progbits
144
145
        clr     __zero_reg__
145
 
        out     _SFR_IO_ADDR(SREG), __zero_reg__
 
146
        out     AVR_STATUS_ADDR, __zero_reg__
146
147
        ldi     r28,lo8(__stack)
147
 
#ifdef SPH
 
148
#ifdef _HAVE_AVR_STACK_POINTER_HI
148
149
        ldi     r29,hi8(__stack)
149
 
        out     _SFR_IO_ADDR(SPH), r29
150
 
#endif
151
 
        out     _SFR_IO_ADDR(SPL), r28
 
150
        out     AVR_STACK_POINTER_HI_ADDR, r29
 
151
#endif  /* _HAVE_AVR_STACK_POINTER_HI */
 
152
        out     AVR_STACK_POINTER_LO_ADDR, r28
 
153
 
 
154
#ifdef __AVR_3_BYTE_PC__
 
155
        ldi     r16, hh8(pm(__vectors))
 
156
        out     _SFR_IO_ADDR(EIND), r16
 
157
#endif  /* __AVR_3_BYTE_PC__ */
152
158
 
153
159
#if BIG_CODE
154
160
        /* Only for >64K devices with RAMPZ, replaces the default code
173
179
.L__do_copy_data_carry:
174
180
        inc     r16
175
181
#endif
176
 
        out     _SFR_IO_ADDR(RAMPZ), r16
 
182
        out     AVR_RAMPZ_ADDR, r16
177
183
        rjmp    .L__do_copy_data_start
178
184
.L__do_copy_data_loop:
179
185
#ifdef __AVR_ENHANCED__
196
202
#endif /* !__AVR_ASM_ONLY__ */
197
203
 
198
204
        .section .init9,"ax",@progbits
 
205
#ifdef __AVR_ASM_ONLY__
 
206
        XJMP    main
 
207
#else   /* !__AVR_ASM_ONLY__ */
199
208
        XCALL   main
200
209
        XJMP    exit
 
210
#endif  /* __AVR_ASM_ONLY__ */
201
211
;       .endfunc
202
212