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

Subversion Repositories openfire2

[/] [openfire2/] [trunk/] [sw/] [crt/] [crt-bram.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
/*      Vector map (Interrupts, Exceptions, Breakpoints)                 */
10
#       # 0x00 #                Jump to Start   (reset vector)
11
#       # 0x04 #                nop
12
#       # 0x08 #                Imm instr for soft exception address [Hi halfword]
13
#       # 0x0c #                Jump to sof Exception handler        [Lo halfword]
14
#       # 0x10 #                Imm instr for interrupt address      [Hi halfword]
15
#       # 0x14 #                Jump to interrupt handler            [Lo halfword]
16
#       # 0x18 #                nop - Reserved for breakpoint vector
17
#       # 0x1C #                nop - Reserved for breakpoint vector
18
#       # 0x20 #                Imm instr for hw exception address   [Hi halfword]
19
#       # 0x24 #                Jump instr to hw exception handler   [Lo halfword]
20
 
21
        .globl _start
22
 
23
        .align 2
24
        .ent _start
25
_start:
26
        bri     _start1                 # 0x00          # reset vector
27
        nop                             # 0x04
28
        nop                             # 0x08          # Reserve space for software exception vector
29
        nop                             # 0x0c
30
        nop                             # 0x10          # Reserve space for interrupt vector
31
        nop                             # 0x14
32
        nop                             # 0x18          # Reserve space for breakpoint vector
33
        nop                             # 0x1c
34
        nop                             # 0x18          # Reserve space for hw exception vector
35
        nop                             # 0x1c
36
 
37
_start1:                                /* Set the Small Data Anchors and the Stack pointer  */
38
        la r13, r0, _SDA_BASE_
39
        la r2, r0, _SDA2_BASE_
40
        la r1, r0, _STACK_START         # stack is at end of block-ram
41
 
42
_crtinit:                               /* clear sbss */
43
        addi    r6,r0,__sbss_start      /* SBSS beginning       */
44
        addi    r7,r0,__sbss_end        /* SBSS end             */
45
        rsub    r18,r6,r7               /* Compare              */
46
        blei    r18,.Lendsbss
47
.Lloopsbss:
48
        sw      r0,r6,r0
49
        addi    r6,r6,4
50
        rsub    r18,r6,r7
51
        bgti    r18,.Lloopsbss
52
.Lendsbss:                              /* clear bss */
53
        addi    r6,r0,__bss_start       /* BSS beginning        */
54
        addi    r7,r0,__bss_end         /* BSS end              */
55
        rsub    r18,r6,r7               /* Compare              */
56
        blei    r18,.Lendbss
57
.Lloopbss:
58
        sw      r0,r6,r0
59
        addi    r6,r6,4
60
        rsub    r18,r6,r7
61
        bgti    r18,.Lloopbss
62
.Lendbss:
63
 
64
        brlid   r15,main                # enter main program (ignoring parameters: r5, r6 & r7)
65
        nop                             # fall throught to exit
66
        .end _start
67
 
68
        .globl exit                     # exit library call
69
        .ent exit
70
exit:
71
        bri     exit
72
        .end exit

powered by: WebSVN 2.1.0

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