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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc2/] [newlib/] [libc/] [sys/] [h8300hms/] [crt0.S] - Blame information for rev 520

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
; h8/300 and h8/300h start up file.
2
 
3
#include "setarch.h"
4
 
5
#ifdef __H8300__
6
 
7
        .section .text
8
        .global _start
9
_start:
10
        mov.w   #_stack,sp
11
        mov.w   #_edata,r0
12
        mov.w   #_end,r1
13
        sub.w   r2,r2
14
.Loop:  mov.w   r2,@r0
15
        adds    #2,r0
16
        cmp     r1,r0
17
        blo     .Loop
18
#ifdef __ELF__
19
        mov.l   #__fini,r0
20
        jsr     @_atexit
21
#ifdef __SIMULATOR__
22
        jsr     @0xcc
23
#endif
24
        jsr     @__init
25
#else
26
#ifdef __SIMULATOR__
27
        jsr     @0xcc
28
#endif
29
        jsr     @___main
30
#endif
31
        jsr     @_main
32
        jsr     @_exit
33
 
34
        .section .stack
35
_stack: .word   1
36
 
37
#endif
38
 
39
#ifdef __H8300H__
40
 
41
        .section .text
42
        .global _start
43
_start:
44
        mov.l   #_stack,sp
45
        mov.l   #_edata,er0
46
        mov.l   #_end,er1
47
        sub.w   r2,r2           ; not sure about alignment requirements
48
.Loop:  mov.w   r2,@er0         ; playing it safe for now
49
        adds    #2,er0
50
        cmp.l   er1,er0
51
        blo     .Loop
52
#ifdef __ELF__
53
        mov.l   #__fini,er0
54
        jsr     @_atexit
55
#ifdef __SIMULATOR__
56
        jsr     @0xcc
57
#endif
58
        jsr     @__init
59
#else
60
#ifdef __SIMULATOR__
61
        jsr     @0xcc
62
#endif
63
        jsr     @___main
64
#endif
65
        jsr     @_main
66
        jsr     @_exit
67
 
68
        .section .stack
69
_stack: .long   1
70
 
71
#endif
72
 
73
#if defined (__H8300S__) || defined (__H8300SX__)
74
 
75
        .section .text
76
        .global _start
77
_start:
78
        mov.l   #_stack,sp
79
        mov.l   #_edata,er0
80
        mov.l   #_end,er1
81
        sub.w   r2,r2           ; not sure about alignment requirements
82
.Loop:  mov.w   r2,@er0         ; playing it safe for now
83
        adds    #2,er0
84
        cmp.l   er1,er0
85
        blo     .Loop
86
#ifdef __ELF__
87
        mov.l   #__fini,er0
88
        jsr     @_atexit
89
#ifdef __SIMULATOR__
90
        jsr     @0xcc
91
#endif
92
        jsr     @__init
93
#else
94
#ifdef __SIMULATOR__
95
        jsr     @0xcc
96
#endif
97
        jsr     @___main
98
#endif
99
        jsr     @_main
100
        jsr     @_exit
101
 
102
        .section .stack
103
_stack: .long   1
104
 
105
#endif

powered by: WebSVN 2.1.0

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