aboutsummaryrefslogtreecommitdiffstats
path: root/loader/crt0.S
blob: bb0a94fb872c469ac8c8b9a26a15041dc1ee3934 (plain)
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
//
// loader/crt0.S
//
// Copyright (C) 2006 Erik Gilling, all rights reserved
//
//	This program is free software; you can redistribute it and/or
//	modify it under the terms of the GNU General Public License as
//	published by the Free Software Foundation, version 2.
//
//
	.EQU	STACK, 0x201C00
		
	.code 32
	.align 2

	.global _entry
	.func	_entry
_entry:
	//  init stack
	ldr	sp, =STACK

	//  save lr
	stmfd	sp!, {lr}

	bl main

	ldmia	sp!, {r0}
	bx	r0