/* A simple hack crt0 */

.set	KSP,0		/* Kernel Stack Pointer */
.set	ISP,4		/* Interrupt Stack Pointer */
.set	SCBB,0x11	/* System Control Block Base */

	.globl	start
	.globl	__start
	.globl	_main
	.globl	_JOBSA

start:
__start:
	.word	0
	mtpr	$tmpstack,$ISP
	mtpr	$tmpstack,$KSP

	/* Get off the Interrupt stack */
	pushl	$0x1f0000	/* A PSL at IPL 1f */
	pushl	$_JOBSA		/* The PC to return to */
	rei


_JOBSA:
	mtpr	$0x100000,$KSP		/* Stack at 256 Kbyte */
	pushl	$0
	pushl	$0
	pushl	$0
	calls	$3,_main
	halt

	.data
/* A temporary stack for startup */
	.align	2
.space	100
tmpstack:
.space	4
