5d453aa00874ed54bca3901e98e6e090ae4f2d73
[savezelda.git] / start.S
1 // Copyright 2008-2009  Segher Boessenkool  <segher@kernel.crashing.org>
2 // This code is licensed to you under the terms of the GNU GPL, version 2;
3 // see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
4
5 #define XSTR(x) #x
6 #define ISTR(x) XSTR(x)
7
8         .section .start,"ax"
9
10         // Uninteresting stuff.
11         .incbin "head.b"
12
13         // "Link".  This is displayed on the load menu, so make it nice.
14 0:      .ascii ISTR(NAME)
15         .fill 17 - (. - 0b)
16
17         // "Epona".  Hungry horse eats the stack.
18         .fill 0xe8,1,'3'
19
20         // The return address on the stack.
21         .long start
22
23         // Align things properly -- there's code after this.
24         .fill 7,1,'S'
25         .balign 4,0
26
27 start:
28         // Set up a stack frame.
29         lis 1,0x8080 ; li 0,0 ; stwu 0,-64(1)
30
31         // Pass the address we are called from, to determine region.
32         mflr 3
33
34         // Go for it!
35         b main