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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [sysnecv850/] [crt0.S] - Blame information for rev 1775

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

Line No. Rev Author Line
1 39 lampret
# NEC V850 startup code
2
 
3
        .section .text
4
        .global _start
5
 
6
_start:
7
 
8 56 joel
#if defined __v850e__ || defined __v850ea__
9 39 lampret
 
10
        movea   255,            r0,     r20
11 56 joel
        mov     65535,          r21
12
        mov     hilo(_stack),   sp
13
        mov     hilo(__ep),     ep
14
        mov     hilo(__gp),     gp
15
        mov     hilo(__ctbp),   r6
16
        ldsr    r6,             ctbp
17
        mov     hilo(_edata),   r6
18
        mov     hilo(_end),     r7
19
.L0:
20
        st.w    r0,             0[r6]
21
        addi    4,              r6,     r6
22
        cmp     r7,             r6
23
        bl      .L0
24
.L1:
25
        jarl    ___main,        r31
26
        addi    -12,            sp,     sp
27
        mov     0,              r6
28
        mov     0,              r7
29
        mov     0,              r8
30
        jarl    _main,          r31
31
        mov     r10,            r6
32
        jarl    _exit,          r31
33
 
34
# else
35
        movea   255,            r0,     r20
36 39 lampret
        mov     r0,             r21
37
        ori     65535,          r0,     r21
38
        movhi   hi(_stack),     r0,     sp
39
        movea   lo(_stack),     sp,     sp
40
        movhi   hi(__ep),       r0,     ep
41
        movea   lo(__ep),       ep,     ep
42
        movhi   hi(__gp),       r0,     gp
43
        movea   lo(__gp),       gp,     gp
44 56 joel
 
45
        /* Initialise the call table base pointer.
46
        We do this even though we are supposedly
47
        assembling this file for the v850 as this
48
        allows us to use the same binary for all
49
        versions of the v850 architecture.  */
50
 
51
        movhi   hi(__ctbp),     r0,     r6
52
        movea   lo(__ctbp),     r6,     r6
53
        ldsr    r6,             ctbp
54
 
55 39 lampret
        movhi   hi(_edata),     r0,     r6
56
        movea   lo(_edata),     r6,     r6
57
        movhi   hi(_end),       r0,     r7
58
        movea   lo(_end),       r7,     r7
59
.L0:
60
        st.b    r0,             0[r6]
61
        addi    1,              r6,     r6
62
        cmp     r7,             r6
63
        bl      .L0
64
.L1:
65
        jarl    ___main,        r31
66
        addi    -12,            sp,     sp
67
        mov     0,              r6
68
        mov     0,              r7
69
        mov     0,              r8
70
        jarl    _main,          r31
71
        mov     r10,            r6
72
        jarl    _exit,          r31
73
 
74 56 joel
# endif
75 39 lampret
 
76
        .section .stack
77
_stack: .long   1

powered by: WebSVN 2.1.0

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