/* $Copyright:	$
 * Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
 * Sequent Computer Systems, Inc.   All rights reserved.
 *  
 * This software is furnished under a license and may be used
 * only in accordance with the terms of that license and with the
 * inclusion of the above copyright notice.   This software may not
 * be provided or otherwise made available to, or used by, any
 * other person.  No title to or ownership of the software is
 * hereby transferred.
 */

#include "assym.h"

	.ident	"$Header: crt0.s 1.8 90/04/20 $"

/* $Log:	crt0.s,v $
 */

/*
 * start()
 *
 * Entry point for standalone programs.  Standalone runs
 * in a flat 4 Gig segment with interrupts disabled.
 */
	.text
	.globl	start
	.align	4
	nop				/* forms magic number for 8K ... */
	nop				/* ... bootstrap for DYNIX/ptx(R) */
	nop
	nop
start:
	cmpb	$0, CD_LOC+c_version	/* PC/3AT? */
	je	3f			/* yes */
	movb	CD_LOC+sd_type, %cl	/* get "sd_type" from config data */
	cmpb	$SYSTYP_S1, %cl		/* PC/3AT? */
	je	4f			/* yes */
	movl	CD_LOC+c_bottom,%esp	/* set initial stack pointer */
	CALL	slic_init		/* set up slic stuff */
1:	CALL	clearbss		/* clear our own bss */
	CALL	main			/* do the work */
	pushl	%eax			/* return value */
2:	CALL	exit			/* exit */
	jmp	2b			/* should not happen */
/*
 *	PC/3AT specific code
 */
3:	movb	$1, CD_LOC+c_version	/* set version */
	movb	$SYSTYP_S1, CD_LOC+sd_type /* set type */
4:	movl	$0x80000, %esp		/* set initial stack pointer */
	jmp	1b

	/* relative speed of machine */
	.data
	.align	4
	.globl	cpuspeed
cpuspeed:
	.long	8
