-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pather_crt0.s
More file actions
60 lines (48 loc) · 1.28 KB
/
er_crt0.s
File metadata and controls
60 lines (48 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@---------------------------------------------------------------------------------
@ nintendo e-reader startup code
@---------------------------------------------------------------------------------
@ author : tim schuerewegen
@ version : 1.0
@---------------------------------------------------------------------------------
@ This Source Code Form is subject to the terms of the Mozilla Public License,
@ v. 2.0. If a copy of the MPL was not distributed with this file, You can
@ obtain one at https://mozilla.org/MPL/2.0/.
@---------------------------------------------------------------------------------
.section ".crt0","ax"
.global _start
.align
.arm
@---------------------------------------------------------------------------------
_start:
@---------------------------------------------------------------------------------
b start_vector
.long 0
.long 0x02000000
start_vector:
@ enter thumb mode
adr r0, _start_thumb + 1
bx r0
.thumb
_start_thumb:
@ save return address (rom)
mov r3, lr
@ clear bss section
ldr r0, =__bss_start
ldr r1, =__bss_end
mov r2, #0
_loop_bss_clear:
strb r2, [r0]
add r0, #1
cmp r0, r1
blt _loop_bss_clear
@ set return address (rom)
mov lr, r3
@ jump to main
ldr r3, =main
bx r3
.align
.pool
.end
.align
.pool
.end