OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [moxie/] [crt0.S] - Blame information for rev 277

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
/* crt0.S -- startup file for moxie
2
 *
3
 * Copyright (c) 2008, 2009  Anthony Green
4
 *
5
 * The authors hereby grant permission to use, copy, modify, distribute,
6
 * and license this software and its documentation for any purpose, provided
7
 * that existing copyright notices are retained in all copies and that this
8
 * notice is included verbatim in any distributions. No written agreement,
9
 * license, or royalty fee is required for any of the authorized uses.
10
 * Modifications to this software may be copyrighted by their authors
11
 * and need not follow the licensing terms described here, provided that
12
 * the new terms are clearly indicated on the first page of each file where
13
 * they apply.
14
 */
15
 
16
        .globl  __start
17
        .weak   _start
18
        .text
19
        .type   __start,@function
20
__start:
21
_start:
22
        ldi.l   $sp, _stack     /* load up stack pointer */
23
        ldi.l   $fp, 0x0        /* zero fp to allow unwinders to stop */
24
 
25
        /* zero the bss area */
26
        dec     $sp, 12
27
        ldi.l   $r0, __bss_start__
28
        ldi.l   $r1, __bss_end__
29
        sub.l   $r1, $r0
30
        sto.l   8($sp), $r1
31
        ldi.l   $r1, 0
32
        jsra    memset
33
        inc     $sp, 12
34
 
35
        /* Call _init to invoke static constructors, etc.  */
36
        jsra    _init
37
 
38
        /* Call _fini at exit time for static destructors.  */
39
        ldi.l   $r0, _fini
40
        jsra    atexit
41
 
42
        /* Set argc and argv.  These are populated by the simulator.  */
43
        lda.l   $r0, 0x4
44
        ldi.l   $r1, 0x8
45
 
46
        jsra    main
47
        jsra    exit
48
 
49
.Lend:
50
        .size   __start,(.Lend-__start)

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.