OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [mn10300/] [crt0-eval.S] - Blame information for rev 822

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

Line No. Rev Author Line
1 148 jeremybenn
##==============================================================================
2
##
3
##      crt0-eval.S
4
##
5
##      MN10300 Series Evaluation Board C startup code
6
##
7
##==============================================================================
8
######COPYRIGHTBEGIN####
9
##
10
## Copyright (c) 1995, 1996, 1997, 1998 Cygnus Solutions
11
##
12
## The authors hereby grant permission to use, copy, modify, distribute,
13
## and license this software and its documentation for any purpose, provided
14
## that existing copyright notices are retained in all copies and that this
15
## notice is included verbatim in any distributions. No written agreement,
16
## license, or royalty fee is required for any of the authorized uses.
17
## Modifications to this software may be copyrighted by their authors
18
## and need not follow the licensing terms described here, provided that
19
## the new terms are clearly indicated on the first page of each file where
20
## they apply.
21
##
22
######COPYRIGHTEND####
23
 
24
##------------------------------------------------------------------------------
25
 
26
        .file   "crt0-eval.S"
27
 
28
##------------------------------------------------------------------------------
29
## Startup code
30
 
31
        .equ    DRAM_TOP,0x48100000
32
 
33
        .text
34
 
35
        .globl  __start
36
__start:
37
        # Set up stack.  Leave 4K at top for use by Cygmon.
38
 
39
        mov     DRAM_TOP - 0x1000,a0
40
        sub     8,a0
41
        mov     a0,sp
42
 
43
        # Clear BSS
44
 
45
        mov     __bss_start,a0
46
        mov     _end,a1
47
 
48
        cmp     a0,a1
49
        beq     8f
50
        clr     d0
51
1:
52
        movbu   d0,(a0)
53
        inc     a0
54
        cmp     a0,a1
55
        bne     1b
56
8:
57
        # Call constructors
58
 
59
        .extern ___main
60
        call    ___main,[],0
61
 
62
        # Call main
63
        clr     d0
64
        clr     d1
65
        mov     d0,(4,sp)
66
 
67
9:
68
        or      0x0800,psw      # Enable interrupts
69
 
70
        .extern _main
71
        call    _main,[],0
72
 
73
        .extern __exit
74
        call    __exit,[],0
75
 
76
#       bra     9b              # Loop if we return
77
 
78
 
79
 
80
##------------------------------------------------------------------------------
81
## end of crt0-eval.S
82
 

powered by: WebSVN 2.1.0

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