summaryrefslogtreecommitdiff
path: root/sys/src/9/teg2/init9.s
blob: 1d7f2bec3c9f6b99d9065747de53d763a17d1b04 (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
/*
 * This is the same as the C programme:
 *
 *	void
 *	main(char* argv0)
 *	{
 *		startboot(argv0, &argv0);
 *	}
 *
 * It is in assembler because SB needs to be
 * set and doing this in C drags in too many
 * other routines.
 */
TEXT main(SB), 1, $8
	MOVW	$setR12(SB), R12		/* load the SB */
	MOVW	$boot(SB), R0

	ADD	$12, R13, R1			/* pointer to 0(FP) */

	MOVW	R0, 4(R13)			/* pass argc, argv */
	MOVW	R1, 8(R13)

	BL	startboot(SB)
_loop:
	B	_loop