crt0.s 815 Bytes
#include <regdef.h>
#include <asm.h>
#include <R4300.h>
#include <PR/bcp.h>
#include "cpusim.h"

LEAF(__start):
	mtc0    zero,C0_CAUSE
	mtc0    zero,C0_COUNT
	mtc0    zero,C0_COMPARE
	mtc0    zero,C0_WATCHLO	/* XXX for the NEC verilog model */
	mtc0    zero,C0_WATCHHI	/* XXX for the NEC verilog model */
	mtc0    zero,C0_TAGLO	/* XXX for the NEC verilog model */
	mtc0    zero,C0_TAGHI	/* XXX for the NEC verilog model */
	mtc0    zero, C0_INX
	mtc0    zero, C0_ENTRYHI
	mtc0    zero, C0_ENTRYLO0
	mtc0    zero, C0_ENTRYLO1
	mtc0    zero, C0_PAGEMASK
	mtc0    zero, C0_LLADDR 
	li	sp,STACK_TOP
	j	main
END(__start)
.set noreorder
.rept (0x200+0x180)/4-17
        nop
.endr
.set reorder
.global __exception
__exception=EXCEPTION_INDIRECT
__general_exception:
	.set noat
	lw	k0, EXCEPTION_INDIRECT
	j	k0
.globl main