{FlapTrap.mc, HGM,  4-Nov-84  6:29:59}


	Reserve[0F5F, 0FFF]; { section used by the CP Kernel }
	SetTask[7]; StartAddress[GetOutOfKernel];
	SetTask[0]; StartAddress[Go];


RegDef[R0,R,0];


GetOutOfKernel:
	ExitKernel,					c1;
	Noop,						c2;
	GOTO[GetOutOfKernel],				c3;
	
Go:	ClrIntErr,					c1;
	R0 ← 0,						c2;
	IB ← 0,	{Scope sync} GOTO[Loop],		c3;
	
Trap:	ClrIntErr,					c1, at[0];
	R0 ← R0 + 1,					c2, at[0FF];
	IB ← 0,	{Scope sync} GOTO[Loop],		c3, at[0F00];
	
Loop:	stackP ← 0,					c1;
	pop,						c2;
	GOTO[Dally],					c3;

Dally:	Noop,						c1;
	Noop,						c2;
	Noop,						c3;

	Noop,						c1;
	Noop,						c2;
	Noop,						c3;

	Noop,						c1;
	Noop,						c2;
	Noop,						c3;

	Noop,						c1;
	Noop,						c2;
	Noop,						c3;

	Noop,						c1;
	Noop,						c2;
	GOTO[Go], {Trap should have happened by now}	c3;