4 .stabs "crt0.S",100,0,0,_start
5 .stabs "int:t(0,1)=r(0,1);-32768;32767;",128,0,0,0
6 .stabs "_start:F(0,1)",36,0,1,_start
10 ; R14 always contains memory base address (0)
14 ; Set the USER and SYSTEM stack pointers.
16 ldi r0, 0 ; zero arguments
18 mvtc r0, psw ; select SPI and set it
20 ldi r10, 0x8000 ; select SPU/FP and set it
21 mvtc r10, psw || ldi r11, 0; clear stack frame
22 ldi sp, _stack - 0x200
25 ; Clear the BSS. Do it in two parts for efficiency: longwords first
26 ; for most of it, then the remaining 0 to 3 bytes.
28 ldi r2, __bss_start ; R2 = start of BSS
29 ldi r3, _end ; R3 = end of BSS + 1
30 sub r3, r2 ; R3 = BSS size in bytes
32 srli r4, 2 ; R4 = BSS size in longwords (rounded down)
34 cmpeqi r4, 0 ; more longords to zero out?
35 brf0t.s endloop1 ; nope
36 st2w r0, @r2+ ; yep, zero out another longword
37 subi r4, 1 ; decrement count
38 bra.l loop1 ; go do some more
41 and3 r4, r3, 3 ; get no. of remaining BSS bytes to clear
43 cmpeqi r4, 0 ; more bytes to zero out?
44 brf0t.s endloop2 ; nope
45 stb r0, @r2 ; yep, zero out another byte
46 addi r2, 1 ; bump address
47 subi r4, 1 ; decrement count
48 bra.s loop2 ; go do some more
50 ; Call main, then stop simulator
59 .size _start,.Lstart-_start
60 .stabs "",36,0,0,.Lstart-_start