/[pcsx2_0.9.7]/branch/r3113_0.9.7_beta/fps2bios/loader/crt0.s
ViewVC logotype

Annotation of /branch/r3113_0.9.7_beta/fps2bios/loader/crt0.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32 - (hide annotations) (download)
Tue Sep 7 03:29:01 2010 UTC (10 years, 10 months ago) by william
File size: 1490 byte(s)
branching from upstream revision (http://pcsx2.googlecode.com/svn/trunk
): r3113 to
https://svn.netsolutions.dnsalias.com/websvn/ps2/pcsx2/pcsx2_0.9.7/branch/r3113_0.9.7_beta
1 william 31 .set noat
2     .set noreorder
3     .global _start
4    
5     .global FlushCache
6     .global Exit
7     .global SignalSema
8     .global _start
9     .global _exit
10    
11     .text
12     nop
13     nop
14     FlushCache:
15     li $3,100
16     syscall
17     jr $31
18     nop
19     Exit:
20     li $3,4
21     syscall
22     jr $31
23     nop
24     SignalSema:
25     li $3,66
26     syscall
27     jr $31
28     nop
29    
30     nop
31     nop
32     _start:
33     lui $2,%hi(_args_ptr)
34     addiu $2,$2, %lo(_args_ptr)
35     sw $4,($2)
36     # Clear bss
37     zerobss:
38     lui $2,%hi(_fbss)
39     lui $3,%hi(_end)
40     addiu $2,$2,%lo(_fbss)
41     addiu $3,$3,%lo(_end)
42     loop:
43     nop
44     nop
45     sq $0,($2)
46     sltu $1,$2,$3
47     bne $1,$0,loop
48     addiu $2,$2,16
49    
50     # Thread
51     lui $4,%hi(_gp)
52     addiu $4,$4,%lo(_gp)
53     lui $5,%hi(_stack)
54     addiu $5,$5,%lo(_stack)
55     lui $6,%hi(_stack_size)
56     addiu $6,$6,%lo(_stack_size)
57     lui $7,%hi(_args)
58     addiu $7,$7,%lo(_args)
59     lui $8,%hi(_root)
60     addiu $8,$8,%lo(_root)
61     move $28,$4
62     addiu $3,$0,60
63     syscall
64     move $29, $2
65    
66     # Heap
67     addiu $3,$0,61
68     lui $4,%hi(_end)
69     addiu $4,$4,%lo(_end)
70     lui $5,%hi(_heap_size)
71     addiu $5,$5,%lo(_heap_size)
72     syscall
73     nop
74    
75     # Cache
76     jal FlushCache
77     move $4,$0
78    
79     # Jump main
80     ei
81    
82     lui $2,%hi(_args_ptr)
83     addiu $2,$2,%lo(_args_ptr)
84     lw $3,($2)
85     lui $2,%hi(_args)
86     addiu $2,$2,%lo(_args)
87    
88     lw $4, ($2)
89     jal main
90     addiu $5, $2, 4
91     _root:
92     _exit:
93     # ???
94     lui $2,%hi(_args_ptr)
95     addiu $2,$2,%lo(_args_ptr)
96     lw $3,($2)
97     jal SignalSema
98     lw $4,($3)
99     # Exit
100     addiu $3,$0,35
101     syscall
102     nop
103    
104     .bss
105     .align 6
106     _args: .space 256+16*4+4
107    
108     .data
109     _args_ptr:
110     .space 4

  ViewVC Help
Powered by ViewVC 1.1.22