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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [sys/] [sysmec/] [crt0.S] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
#ifdef __mn10300__
2
        .section .text
3
        .global _start
4
_start:
5
        mov _stack-8,a0         # Load up the stack pointer
6
        mov a0,sp
7
 
8
        mov _edata,a0           # Get the start/end of bss
9
        mov _end,a1
10
 
11
        cmp a0,a1               # If no bss, then do nothing
12
        beq .L0
13
 
14
        clr d0                  # clear d0
15
 
16
.L1:
17
        movbu d0,(a0)           # Clear a byte and bump pointer
18
        inc a0
19
        cmp a0,a1
20
        bne .L1
21
 
22
.L0:
23
        call ___main,[],0       # Call __main to run ctors/dtors
24
        clr d0
25
        clr d1
26
        mov d0,(4,sp)
27
        call _main,[],0         # Call main program
28
        call _exit,[],0         # All done, no need to return or
29
                                # deallocate our stack.
30
 
31
        .section ._stack
32
_stack: .long   1
33
#else
34
        .section .text
35
        .global _start
36
_start:
37
        mov _stack-4,a3         # Load up the stack pointer and allocate
38
                                # our current frame.
39
 
40
        mov _edata,a0           # Get the start/end of bss
41
        mov _end,a1
42
 
43
        cmp a0,a1               # If no bss, then do nothing
44
        beqx .L0
45
 
46
        sub d0,d0               # clear d0
47
 
48
.L1:
49
        movb d0,(a0)            # Clear a byte and bump pointer
50
        add 1,a0
51
        cmp a0,a1
52
        bnex .L1
53
 
54
.L0:
55
        jsr ___main
56
        sub d0,d0
57
        mov d0,d1
58
        mov d0,(a3)
59
        jsr _main               # Call main program
60
        jmp _exit               # All done, no need to return or
61
                                # deallocate our stack.
62
 
63
        .section ._stack
64
_stack: .long   1
65
#endif

powered by: WebSVN 2.1.0

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