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

Contents of /branch/r3113_0.9.7_beta/fps2bios/intro/crt0.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31 - (show annotations) (download)
Tue Sep 7 03:24:11 2010 UTC (10 years, 10 months ago) by william
Original Path: trunk/fps2bios/intro/crt0.s
File size: 1507 byte(s)
committing r3113 initial commit again...
1 .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 jr $31
103 nop
104
105 .bss
106 .align 6
107 _args: .space 256+16*4+4
108
109 .data
110 _args_ptr:
111 .space 4

  ViewVC Help
Powered by ViewVC 1.1.22