/*
 * Startup code for standalone system
 */

	.globl	_end
	.globl	_edata
	.globl	_main

	.set	IPL,0x12	/* IPL reg */
	.set	SCBB,0x11	/* SCB Base */

	.set	HIGH,31		# mask for total disable

	.globl	entry
entry:	.word	0x0
/*	mtpr	$HIGH,$IPL		# just in case */

start:
	subl3	$_edata,$_end,r6	# size of bss
	movc5	$0,0,$0,r6,_edata	# clear it all

/******
	movl	aedata,r0
clr:
	clrl	(r0)+
	cmpl	r0,sp
	jlss	clr
	mtpr	$0,$SCBB
********/
	calls	$0,_main

	halt
	jmp	start

/*****
	.globl	_badloc
_badloc:
	.word	0
	movl	$1,r0
	movl	4(ap),r3
	movl	$4,r2
	movab	9f,(r2)
	tstl	(r3)
1:	clrl	r0			# made it w/o machine checks
2:	movl	$4,r2
	clrl	(r2)
	ret
	.align	2
9:
	casel	_cpu,$1,$VAX_MAX
0:
	.word	8f-0b		# 1 is 780
	.word	5f-0b		# 2 is 750
	.word	5f-0b		# 3 is 730
5:
	mtpr	$0xf,$MCESR
	brb	1f
8:
	mtpr	$0,$SBIFS
1:
	addl2	(sp)+,sp		# discard mchchk trash
	movab	2b,(sp)
	rei
****/
