/************************************************************************/
/* CQBBEL GNU CC Common Control Software / (C) Toshio MURAI 2011, 2012	*/
/*      This is Free Software;   You can redistribute this software     */
/*      and/or modify it under the terms of the GNU General Public      */
/*      License version 3, or (at your option) any later version.       */
/************************************************************************/
/* Template C program to generate crt0.s	*/


int	systemStack[100];
extern	void main(void);
extern	void initializeMemory(void);
static int	*stackRegister;
static int	statusRegister;

extern	void interruptHandler(void);

int start() {			
	register int *stack = systemStack;
	stackRegister = stack;
	initializeMemory();
	main();	
	while(1);
}

void enableInterrut(void) {
	register int status = statusRegister;
	status &= ~0x080;	// 8bit Mask on
	statusRegister =status;
}

void disableInterrupt(void) {
	register int status = statusRegister;
	status |= 0x80;		// 8bit Mask off
	statusRegister =status;
}
