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

Subversion Repositories openfire2

[/] [openfire2/] [trunk/] [sw/] [crt/] [crt-sram.s] - Blame information for rev 3

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

Line No. Rev Author Line
1 3 toni32
# crt.asm
2
#       C RunTime:
3
#       Used for initialization of small data
4
#       anchors and stack for programs compiled using
5
#       Xilinx Gnu Tools.
6
#       Used for initialization of user's bss area
7
#       All external and static variables are initialized
8
 
9
        .globl _start
10
 
11
        .align 2
12
        .ent _start
13
_start:
14
        /* todo : initialize system vectors */
15
 
16
                                        /* Set the Small Data Anchors and the Stack pointer  */
17
        la r13, r0, _SDA_BASE_
18
        la r2, r0, _SDA2_BASE_
19
        la r1, r0, _stack               # stack is at end of heap
20
 
21
_crtinit:                               /* clear sbss */
22
        addi    r6,r0,__sbss_start      /* SBSS beginning       */
23
        addi    r7,r0,__sbss_end        /* SBSS end             */
24
        rsub    r18,r6,r7               /* Compare              */
25
        blei    r18,.Lendsbss
26
.Lloopsbss:
27
        sw      r0,r6,r0
28
        addi    r6,r6,4
29
        rsub    r18,r6,r7
30
        bgti    r18,.Lloopsbss
31
.Lendsbss:                              /* clear bss */
32
        addi    r6,r0,__bss_start       /* BSS beginning        */
33
        addi    r7,r0,__bss_end         /* BSS end              */
34
        rsub    r18,r6,r7               /* Compare              */
35
        blei    r18,.Lendbss
36
.Lloopbss:
37
        sw      r0,r6,r0
38
        addi    r6,r6,4
39
        rsub    r18,r6,r7
40
        bgti    r18,.Lloopbss
41
.Lendbss:
42
 
43
        brlid   r15,main                # enter main program (ignoring parameters: r5, r6 & r7)
44
        nop                             # fall throught to exit
45
        .end _start
46
 
47
        .globl exit                     # exit library call
48
        .ent exit
49
exit:
50
        brai    0x0                     # enter monitor again...
51
        .end exit

powered by: WebSVN 2.1.0

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