summaryrefslogtreecommitdiff
path: root/klibc/klibc/arch/ppc/crt0.S
blob: f7274b07dd549cde876985c3ac13f7dfa9422a9c (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
29
#
# arch/ppc/crt0.S
#
# void _start(void)
# {
#    /* Divine up argc, argv, and envp */
#    environ = envp;
#    exit(main(argc, argv, envp));
# } 
#

	.text
	.align 4
	.type _start,@function
	.globl _start
_start:
	lwz	3,0(1)
	addi	4,1,4
	addi	5,1,8
	slwi	0,3,2
	add	5,5,0
	li	0,0
	stwu	0,-16(1)
	lis	9,environ@ha
	stw	5,environ@l(9)
	bl	main
	bl	exit
	
	.size _start,.-_start