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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [fr30/] [crt0.s] - Blame information for rev 825

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

Line No. Rev Author Line
1 148 jeremybenn
# FR30 startup code
2
 
3
        .section .text
4
        .global _start
5
_start:
6
 
7
        ;; Initialise the stack pointer
8
        ldi:32  __stack, r0
9
        mov     r0, sp
10
        mov     r0, fp
11
 
12
        ;; Zero the data space
13
        ldi:32  #_edata, r0
14
        ldi:32  #_end,   r1
15
        ldi:8   #0,       r2
16
.L0:
17
        st      r2, @r0
18
        add     #4, r0
19
        cmp     r1, r0
20
        blt     .L0
21
 
22
        ;; Call global and static constructors
23
        ldi:32  _init, r0
24
        call    @r0
25
 
26
        ;;  Setup destrcutors to be called from exit.
27
        ;;  (Just in case main never returns....)
28
        ldi:32  atexit, r0
29
        ldi:32  _fini, r4
30
        call    @r0
31
 
32
        ;;  Initialise argc, argv and envp to empty
33
        ldi:8   #0, r4
34
        ldi:8   #0, r5
35
        ldi:8   #0, r6
36
 
37
        ;; Call main
38
        ldi:32  main, r0
39
        call    @r0
40
 
41
        ;; Jump to exit
42
        ldi:32  exit, r0
43
        call    @r0
44
 
45
        ;; Should never reach here
46
        int     #9

powered by: WebSVN 2.1.0

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