{File name dbLispMapB1.mc
Created: 24-Apr-84 10:00:25 
}

SetTask[0];

{*************************
	Read Map Update Subroutine 
**************************}
{Timing: 4 cycles}
{Enter at cycle 3, returns to cycle1}
{returns thru L0 if map fixed ok}
{returns thru L1 if wants to trap}



{--- not used yet

RLMapFixB2:
	Xbus ← Rx LRot0, XwdDisp,	c3;

	Map ← [rhTT,TT], DISP2[RFixRFlagsB1],	c1;

	MDR ← Rx or 80, L0Disp, GOTO[ReReadB1],	c2, at[PgClean, 4, RFixRFlagsB1];
	MDR ← Rx or 80, L0Disp, GOTO[ReReadB1],	c2, at[PgDirty, 4, RFixRFlagsB1];
	MDR ← Rx or 80, L0Disp, GOTO[ReReadB1],	c2, at[PgProt, 4, RFixRFlagsB1];
	L1Disp, GOTO[RWTrapB1],	c2, at[PgVacant, 4, RFixRFlagsB1];

ReReadB1:
	Xbus ← ReadOK, XDisp, RET[RMapFixCallerB1],	c3;

---}

{*************************
	Write Map Update Subroutine 
**************************}
{Timing: 4 cycles}
{Enter at cycle 3, returns to cycle1}
{returns thru L0 if map fixed ok}
{returns thru L1 if wants to trap}

WLMapFixB1:
	Xbus ← Rx LRot0, XwdDisp,	c3;
	Map ← [rhTT, TT], WriteDISP2[FixWFlagsB1],	c1;

	MDR ← Rx or 0C0, L0Disp, GOTO[ReWriteB1],	c2, at[PgWrtOK, 4, FixWFlagsB1];
	L1Disp, GOTO[RWTrapB1],	c2, at[PgNoWrt, 4, FixWFlagsB1];

ReWriteB1:
	Xbus ← PgDirty, XDisp, RET[WMapFixCallerB1],	c3;

RWTrapB1:
	DISP4[TrapFixesB1],	c3;

	GOTO[TrapFixesDoneB1c2],	c1, at[L1.NoFixesB2, 10, TrapFixesB1];

	TOS ← uTOS,	c1, at[L1.RestoreTosB2, 10, TrapFixesB1];
	TOSH ← uTOSH, GOTO[TrapFixesDoneB1c3],	c2;

{	GOTO[DLFix],	c1, at[L1.DLFixesB2, 10, TrapFixesB1];}
{	GOTO[FFTFix],	c1, at[L1.FFTFixesB2, 10, TrapFixesB1];}

TrapFixesDoneB1c2:
	,	c2;
TrapFixesDoneB1c3:
	,	c3;

B1CrossToPFaultc1:
	Bank ← 0,	c1;
	L1 ← L1.NoFixes,CROSS[PFaultB0],	c2;

ufnZ3:
	,	c3;
ufnZ1:
	,	c1;
ufnZ2:
	TOS ← uTOS,	c2;
	TOSH ← uTOSH, GOTO[ufnX1],	c3;

ufnX2:
	,	c2;
ufnX3:
	,	c3;

ufnX1:
	Bank ← 0,	c1;
	S ← S + 1, CROSS[ufnB0],	c2;

{OpTable:
	Bank ← 0,	c1, at[OpcodeBase];
	CROSS[OpcodeBase],c2;
}
	{ E N D }