Ejemplo n.º 1
0
/*
 *	usrmain() - start the monitor
 *
 *  This function is called from from rom_entry. It initialises the
 *	serial port (ASC0) and then starts the monitor program.
 *
*/
void usrmain(void)
{
#if (ASC0_PORT==0)
	gpio_port_config(0, 4, GPIO_MODE_OUT|GPIO_MODE_ALT2);
	gpio_port_config(0, 5, GPIO_MODE_IN);
	asc_init(ASC0, 1);
#elif (ASC0_PORT==2)
	gpio_port_config(2, 4, GPIO_MODE_OUT|GPIO_MODE_ALT1);
	gpio_port_config(2, 5, GPIO_MODE_IN);
	asc_init(ASC0, 0);
#endif
	ASC0->asc_tbuf = '\r';	/* kick out a character to start things rolling */
	printf("qdf version 0.1, copyright 2001 David Haworth\n");
	printf("qdf comes with ABSOLUTELY NO WARRANTY. It is free software,\n");
	printf("and you are welcome to redistribute it under certain conditions.\n");
	printf("Please read the file COPYING for details.\n");
	for (;;)
		do_forth(&forth_env);
}
Ejemplo n.º 2
0
static void
_init(void)
{
	int i;
	acf_t f_error_addr;
	fcode_env_t *env;

	NOTICE;

	fcode_impl_count = 0;
	env = MALLOC(sizeof (fcode_env_t));
	env->table = MALLOC((MAX_FCODE + 1) * sizeof (fcode_token));
	env->base = MALLOC(dict_size);
	env->here = env->base;
	env->ds = env->ds0 = MALLOC(stack_size * sizeof (fstack_t));
	env->rs = env->rs0 = MALLOC(stack_size * sizeof (fstack_t));
	env->order = MALLOC(MAX_ORDER * sizeof (token_t));
	env->input = MALLOC(sizeof (input_typ));
	env->num_base = 0x10;

	/* Setup the initial forth environment */
	do_forth(env);
	do_definitions(env);
	install_handlers(env);

	initial_env = env;

	/*
	 * Need to define this early because it is the default for
	 * all unimpl, FCODE functions
	 */
	P1275(0x0fc, IMMEDIATE,	"ferror",		f_error);
	f_error_addr = LINK_TO_ACF(env->lastlink);
	for (i = 0; i <= MAX_FCODE; i++) {
		DEBUGF(ANY, env->table[i].usage = 0);
		SET_TOKEN(i, IMMEDIATE, "ferror", f_error_addr);
	}
	fcode_impl_count = 0;
}
Ejemplo n.º 3
0
static void gui_button_cb_forth (I, GuiButtonEvent event) {
	(void) event;
	iam (HyperPage);
	do_forth (me);
}
Ejemplo n.º 4
0
static void menu_cb_forth (EDITOR_ARGS) {
	EDITOR_IAM (HyperPage);
	do_forth (me);
}