{File name:  StartLisp.mc
 don 19-Aug-83 15:28:50
 }

Reserve[0F6F]; Reserve[0F78]; Reserve[0F7F,0FFF];	{Kernel}

SetTask[0];

Set[IOPage.keyBitsm1, 39];

StartAddress[Germ];

Germ:
	L ← 41, CANCELBR[SetMDS,0F],	c1, at[0,2,Germ];
	L ← 41, CANCELBR[SetMDS,0F],	c1, at[1,2,Germ];

SetMDS:
	IOPCtl ← IOPInMode,	c2;
	DCtl ← L LRot0,	c3;

	uWP ← 0, ClrIntErr,	c1;
	TOS ← 0, rhMDS ← 0	c2;
	rhTT ← TT ← uIOPage,	c3;

{set all keys up; 1403A thru 14040 ← -1}
	stackP ← 0,	c1;
	T ← 0FF LShift1, SE ← 1,	c2;
	Q ← 7,	c3;

KeyLoop:	MAR ← [rhTT,IOPage.keyBitsm1+Q], BRANCH[$,KeyDone],	c1;
	MDR ← L xor ~L, CANCELBR[$,0],	c2;
	Q ← Q - 1, ZeroBr, GOTO[KeyLoop],	c3;

KeyDone:
	KCtl ← 0, PC ← 0+0+1, CANCELBR[$,0],	c2;
	uWDC ← PC,	c3;

	MAR ← [rhTT, IOPage.DSCB.fieldCmd+0],	c1;
	MDR ← L,	c2;
	T ← T + 3,	c3;

LastChance:
	MAR ← [rhTT, IOPage.DSCB.syncCmd+0],	c1;
	MDR ← L,	c2;
	L ← 0, GOTO[EFCHaveLink],	c3;