started working on interrupts
[psx_test1] / src / startup.S
1 #include <regdef.h>
2
3         .equ REG_BASE, 0x1f80
4         .equ REG_GP0, 0x1810
5         .equ REG_GP1, 0x1814
6
7         .set noreorder
8         .section .startup
9
10         .extern main
11         .extern _stacktop
12         .extern _gp
13         .extern _bss_start
14         .extern _bss_end
15
16         .globl _start
17 _start:
18         la sp, _stacktop
19         la gp, _gp
20
21         la t0, _bss_start
22         la t1, _bss_end
23         nop
24         beq t0, t1, donebss
25         nop
26 zerobss:
27         sw zero, (t0)
28         addi t0, t0, 4
29         nop
30         bne t0, t1, zerobss
31         nop
32 donebss:
33
34         jal main
35         nop
36
37 0:      b 0b
38         nop
39
40 # vi:ts=8 sts=8 sw=8 ft=mips: