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

Subversion Repositories layer2

[/] [layer2/] [trunk/] [sw/] [common/] [boot.s] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 idiolatrie
################################################################################
2
# Boot Up Code                                                                 #
3
#------------------------------------------------------------------------------#
4
# REFERENCES                                                                   #
5
#                                                                              #
6
#    [1] The MIPS programmer's handbook                                        #
7
#        Erin Frquhar and Philip Bunce                                         #
8
#        San Francisco, CA, Morgan Kaufmann Publishers, 1994                   #
9
#        ISBN 1-55860-297-6                                                    #
10
#                                                                              #
11
#------------------------------------------------------------------------------#
12
# Copyright (C)2011  Mathias Hörtnagl <mathias.hoertnagl@gmail.com>            #
13
#                                                                              #
14
# This program is free software: you can redistribute it and/or modify         #
15
# it under the terms of the GNU General Public License as published by         #
16
# the Free Software Foundation, either version 3 of the License, or            #
17
# (at your option) any later version.                                          #
18
#                                                                              #
19
# This program is distributed in the hope that it will be useful,              #
20
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
21
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
22
# GNU General Public License for more details.                                 #
23
#                                                                              #
24
# You should have received a copy of the GNU General Public License            #
25
# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
26
################################################################################
27
 
28
        .ifndef STACKSIZE             # Stack size in byte.
29
        .set    STACKSIZE, 8192
30
        .endif
31
 
32
        .comm   stack, STACKSIZE     # Global memory: stack.
33
 
34
        .text
35
        .align  2
36
################################################################################
37
# Execution Start                                                              #
38
#------------------------------------------------------------------------------#
39
        .globl  boot
40
        .ent       boot
41
boot:
42
        .set    noreorder
43
 
44
        la         $gp, _gp                   # Set global pointer.
45
        la         $sp, stack+STACKSIZE-24         # Set stack pointer.
46
 
47
        la      $v0, _bss_start         # Global variable region start.
48
        la      $v1, _bss_end           # Global variable region end.
49
 
50
clrbss:                          # Clear global variable region.
51
        sw      $0, ($v0)
52
        addiu $v0, 4
53
        blt     $v0, $v1, clrbss        # Continue execution when .bss region is clear.
54
        nop
55
 
56
   .set  noat
57
   and   $at, $0, $0             # Clear all registers.
58
   .set  at
59
   and   $v0, $0, $0
60
   and   $v1, $0, $0
61
   and   $a0, $0, $0
62
   and   $a1, $0, $0
63
   and   $a2, $0, $0
64
   and   $a3, $0, $0
65
   and   $t0, $0, $0
66
   and   $t1, $0, $0
67
   and   $t2, $0, $0
68
   and   $t3, $0, $0
69
   and   $t4, $0, $0
70
   and   $t5, $0, $0
71
   and   $t6, $0, $0
72
   and   $t7, $0, $0
73
   and   $s0, $0, $0
74
   and   $s1, $0, $0
75
   and   $s2, $0, $0
76
   and   $s3, $0, $0
77
   and   $s4, $0, $0
78
   and   $s5, $0, $0
79
   and   $s6, $0, $0
80
   and   $s7, $0, $0
81
   and   $t8, $0, $0
82
   and   $t9, $0, $0
83
   and   $k0, $0, $0
84
   and   $k1, $0, $0
85
   and   $fp, $0, $0
86
   and   $ra, $0, $0
87
 
88
        jal     main                    # Start execution of the C main procedure.
89
        nop
90
 
91
loop:                            # Final loop. Afer returning from C main loop.
92
   nop
93
        j       loop                       # Real Infinity.
94
        nop
95
   nop
96
 
97
        .set    reorder
98
        .end    boot
99
 
100
 
101
################################################################################
102
# Start Flash Application                                                      #
103
#------------------------------------------------------------------------------#
104
   .globl   start
105
        .ent       start
106
start:
107
        .set    noreorder
108
 
109
   lui   $k0, 0x2000
110
   jr    $k0
111
   nop
112
 
113
        .set    reorder
114
        .end    start

powered by: WebSVN 2.1.0

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