{File name Kiku2MLoadStore.mc
Description: Mesa Load and Store op-codes
Author: Sandman
Created: February 16, 1980
I. Yamaura, 1-Nov-84 10:36:26, Change for 2M word at {+++}
Daniels, 15-Jun-83 18:01:14,  New instruction set.
Fay, 29-Apr-83 16:31:38,  Changed L1.PushDec2 to L1.Push in SGDB to handle PC correctly on page faults
Sandman, November 10, 1981  11:27 AM,  New Instruction Set
	Garner, April 1, 1980  12:20 PM}

{
LLn	Load Local n = 0-11
LLB	Load Local Byte
LLDn	Load Local Double n = 0-8,10
LLDB	Load Local Double Byte

SLn	Store Local n = 0-10
SLB	Store Local Byte
SLDn	Store Local Double n = 0-6,8
SLDB	Store Local Double Byte

LIN1	Load Immediate Negative One
LINI	Load Immediate Negative Infinity
LIn	Load Immediate n = 0-10
LIB	Load Immediate Byte
LINB	Load Immediate Negative Byte
LIW	Load Immediate Word
LID0	Load Immediate Double Zero

LAn	Local Address n = 0-3,6,8
LAB	Local Address Byte
LAW	Local Address Word

PLn	Put Local n = 0-3
PLB	Put Local Byte
PLDn	Put Local Double n = 0
PLDB	Put Local Double Byte

GAn	Global Address n = 0-1
GAB	Global Address Byte
GAW	Global Address Word

LGn	Load Global n = 0-2
LGB	Load Global Byte
LGDn	Load Global Double n = 0,2
LGDB	Load Global Double Byte

SGB	Store Global Byte
SGDB	Store Global Double Byte
}
{Times for memory operations are + 2 if page cross + 2 if fix map flags} 

{L2	LSMap}
MacroDef[LSr, at[#1,10,LSRtn]];
Set[L2.LL,  1]; Set[L2.LLx, Or[L2.LL, 2]];
Set[L2.LLD, 5]; Set[L2.LLDx, Or[L2.LLD, 2]];
Set[L2.SL,  0];
Set[L2.SLD, 9]; Set[L2.SLDx, Or[L2.SLD, 2]];
Set[L2.PLD, 0D];
Set[L2.SLDn, 4];

{*****************************************************************************
	LLn{n:[0..11]} Load Local n   1 click
*****************************************************************************}
@LL0:	MAR ← Q ← [rhL, L+0], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[1'b];
@LL1:	MAR ← Q ← [rhL, L+1], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[2'b];
@LL2:	MAR ← Q ← [rhL, L+2], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[3'b];
@LL3:	MAR ← Q ← [rhL, L+3], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[4'b];
@LL4:	MAR ← Q ← [rhL, L+4], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[5'b];
@LL5:	MAR ← Q ← [rhL, L+5], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[6'b];
@LL6:	MAR ← Q ← [rhL, L+6], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[7'b];
@LL7:	MAR ← Q ← [rhL, L+7], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[10'b];
@LL8:	MAR ← Q ← [rhL, L+8], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[11'b];
@LL9:	MAR ← Q ← [rhL, L+9], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[12'b];
@LL10:	MAR ← Q ← [rhL, L+0A], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[13'b];
@LL11:	MAR ← Q ← [rhL, L+0B], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[14'b];

LLn:	STK ← TOS, PC ← PC + PC16, IBDisp, L2←L2.LL, BRANCH[LLa,LLb,1],	c2;
LLa:	TOS ← MD, push, fZpop, DISPNI[OpTable],				c3;
LLb:	Rx ← UvL, GOTO[LSMap],						c3;


{*****************************************************************************
	LLB Load Local Byte   1 click
*****************************************************************************}
@LLB:	MAR ← Q ← [rhL, L+ib], L1←L1.PopDec2, push,		c1, opcode[15'b];
	STK ← TOS, PC ← PC + 1, IBDisp, L2←L2.LL, BRANCH[LLa,LLb,1],	c2;


{*****************************************************************************
	LGn{n:[0..2]} Load Global n   1 click
*****************************************************************************}
@LG0:	MAR ← Q ← [rhG, G+0], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[64'b];
@LG1:	MAR ← Q ← [rhG, G+1], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[65'b];
@LG2:	MAR ← Q ← [rhG, G+2], L1←L1.PopDec, push, GOTO[LLn],	c1, opcode[66'b];


{*****************************************************************************
	LGB Load Global Byte   1 click
*****************************************************************************}
@LGB:	MAR ← Q ← [rhG, G+ib], L1←L1.PopDec2, push,		c1, opcode[67'b];
	STK ← TOS, PC ← PC + 1, IBDisp, L2←L2.LL, BRANCH[LGa,LGb,1],	c2;
LGa:	TOS ← MD, push, fZpop, DISPNI[OpTable],				c3;
LGb:	Rx ← UvG, GOTO[LSMap],						c3;


{*****************************************************************************
	LLDn Load Local Double n, n = 0-8,10  2 clicks
*****************************************************************************}
@LLD0:	MAR ← Q ← [rhL, L + 0], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[16'b];
@LLD1:	MAR ← Q ← [rhL, L + 1], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[17'b];
@LLD2:	MAR ← Q ← [rhL, L + 2], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[20'b];
@LLD3:	MAR ← Q ← [rhL, L + 3], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[21'b];
@LLD4:	MAR ← Q ← [rhL, L + 4], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[22'b];
@LLD5:	MAR ← Q ← [rhL, L + 5], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[23'b];
@LLD6:	MAR ← Q ← [rhL, L + 6], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[24'b];
@LLD7:	MAR ← Q ← [rhL, L + 7], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[25'b];
@LLD8:	MAR ← Q ← [rhL, L + 8], push, L1←L1.Pop2Dec, GOTO[LLDn], c1, opcode[26'b];
@LLD10:	MAR ← Q ← [rhL, L + 0A], push, L1←L1.Pop2Dec,GOTO[LLDn], c1, opcode[27'b];

LLDn:	STK ← TOS, PC ← PC + PC16, push, L2←L2.LLD, BRANCH[LLDa, LLDb,1],	c2;
LLDa:	T ← MD, GOTO[LLD2],						c3;
LLDb:	Rx ← UvL, GOTO[LSMap],						c3;

LLD2:	MAR ← Q ← [rhL, Q + 1],						c1;
	STK ← T, IBDisp, L2←L2.LL, BRANCH[LLa,LLb,1],			c2;


{*****************************************************************************
	LLDB Load Local Double Byte  2 clicks
*****************************************************************************}
@LLDB:	MAR ← Q ← [rhL, L + ib], push, L1←L1.Pop2Dec2,		c1, opcode[30'b];
	STK ← TOS, PC ← PC + 1, push, L2←L2.LLD, BRANCH[LLDa, LLDb,1],	c2;


{*****************************************************************************
	LGDn Load Global Double n, n = 0,2  2 clicks
*****************************************************************************}
@LGD0:	MAR ← Q ← [rhG, G + 0], push, L1←L1.Pop2Dec, GOTO[LGDn], c1, opcode[70'b];
@LGD2:	MAR ← Q ← [rhG, G + 2], push, L1←L1.Pop2Dec, GOTO[LGDn], c1, opcode[71'b];
LGDn:	STK ← TOS, PC ← PC + PC16, push, BRANCH[LGDa,LGDb,1],		c2;


{*****************************************************************************
	LGDB Load Global Double Byte  2 clicks
*****************************************************************************}
@LGDB:	MAR ← Q ← [rhG, G + ib], push, L1←L1.Pop2Dec2,		c1, opcode[72'b];
	STK ← TOS, PC ← PC + 1, push, L2←L2.LLD, BRANCH[LGDa,LGDb,1],	c2;
LGDa:	T ← MD, GOTO[LGD2],						c3;
LGDb:	Rx ← UvG, GOTO[LSMap],					c3;

LGD2:	MAR ← Q ← [rhG, Q + 1],						c1;
	STK ← T, IBDisp, L2←L2.LL, BRANCH[LGa,LGb,1],			c2;


{*****************************************************************************
	LIn{n:[0..10]} Load Immediate n   1 click
*****************************************************************************}
@LI0:	T ← 0, push, GOTO[LIn],					c1, opcode[300'b];
@LI1:	T ← 1, push, GOTO[LIn],					c1, opcode[301'b];
@LI2:	T ← 2, push, GOTO[LIn],					c1, opcode[302'b];
@LI3:	T ← 3, push, GOTO[LIn],					c1, opcode[303'b];
@LI4:	T ← 4, push, GOTO[LIn],					c1, opcode[304'b];
@LI5:	T ← 5, push, GOTO[LIn],					c1, opcode[305'b];
@LI6:	T ← 6, push, GOTO[LIn],					c1, opcode[306'b];
@LI7:	T ← 7, push, GOTO[LIn],					c1, opcode[307'b];
@LI8:	T ← 8, push, GOTO[LIn],					c1, opcode[310'b];
@LI9:	T ← 9, push, GOTO[LIn],					c1, opcode[311'b];
@LI10:	T ← 0A, push, GOTO[LIn],				c1, opcode[312'b];

LIn:	STK ← TOS, PC ← PC + PC16, IBDisp,				c2;
PushT:	TOS ← T, push, fZpop, DISPNI[OpTable],				c3;


{*****************************************************************************
	LIN1 Load Immediate Negative One   1 click
*****************************************************************************}
@LIN1:	T ← T xor ~T, push, GOTO[LIn],				c1, opcode[313'b];


{*****************************************************************************
	LINI Load Immediate Negative Infinity   1 click
*****************************************************************************}
@LINI:	T ← RShift1 0, SE ← 1, push, GOTO[LIn],			c1, opcode[314'b];


{*****************************************************************************
	LIB Load Immediate Byte   1 click
*****************************************************************************}
@LIB:	T ← ib, push,						c1, opcode[315'b];
	STK ← TOS, PC ← PC + 1, IBDisp, GOTO[PushT],			c2;


{*****************************************************************************
	LIW Load Immediate Word    2 clicks
*****************************************************************************}
@LIW:	T ← ib, push,						c1, opcode[316'b];
LIWx:	PC ← PC + 1,							c2;
	T ← T LRot8,							c3;

	T ← T or ib, GOTO[LIn],						c1;


{*****************************************************************************
	LINB Load Immediate Negative Byte   1 click
*****************************************************************************}
@LINB:	Q ← ib, push,						c1, opcode[317'b];
	STK ← TOS, PC ← PC + 1, push, fZpop, IBDisp,			c2;
	TOS ← Q xor ~0FF, DISPNI[OpTable],				c3;


{*****************************************************************************
	LIHB Load Immediate High Byte    1 click
*****************************************************************************}
@LIHB:	T ← ib, push,						c1, opcode[320'b];
	STK ← TOS, PC ← PC + 1, push, fZpop, IBDisp,			c2;
	TOS ← T LRot8, DISPNI[OpTable],					c3;


{*****************************************************************************
	LID0 Load Immediate Double Zero   1 click
*****************************************************************************}
@LID0:	push,							c1, opcode[321'b];
	STK ← TOS, PC ← PC + PC16, push, IBDisp,			c2;
	STK ← TOS ← 0, push, fZpop, DISPNI[OpTable],			c3;


{*****************************************************************************
	LAn Local Address n, n = 0-3,6,8    2 clicks
*****************************************************************************}
@LA0:	T ← UvL, push, GOTO[LIn],				c1, opcode[322'b];
@LA1:	T ← 1, push, GOTO[LAa],					c1, opcode[323'b];
@LA2:	T ← 2, push, GOTO[LAa],					c1, opcode[324'b];
@LA3:	T ← 3, push, GOTO[LAa],					c1, opcode[325'b];
@LA6:	T ← 6, push, GOTO[LAa],					c1, opcode[326'b];
@LA8:	T ← 8, push, GOTO[LAa],					c1, opcode[327'b];
LAa:	Noop,								c2;
LAb:	TT ← UvL,							c3;

LAc:	T ← TT + T, GOTO[LIn],						c1;


{*****************************************************************************
	LAB Local Address Byte    2 clicks
*****************************************************************************}
@LAB:	T ← ib, push,						c1, opcode[330'b];
	PC ← PC + PC16, GOTO[LAb],					c2;


{*****************************************************************************
	LAW Local Address Word    2 clicks
*****************************************************************************}
@LAW:	T ← ib, push, L0←0,					c1, opcode[331'b];
	T ← T LRot8,							c2;
LAWa:	T ← T or ib,	 						c3;

	PC ← PC + 1, L0Disp,						c1;
	BRANCH[LAb, GABa],						c2;
	

{*****************************************************************************
	GAn Global Address n, n = 0-1    1 clicks
*****************************************************************************}
@GA0:	T ← UvG, push, GOTO[LIn],				c1, opcode[332'b];
@GA1:	T ← 1, push,						c1, opcode[333'b];
	GOTO[GABa],							c2;


{*****************************************************************************
	GAB Global Address Byte    2 clicks
*****************************************************************************}
@GAB:	T ← ib, push,						c1, opcode[334'b];
	PC ← PC + PC16,							c2;
GABa:	TT ← UvG, GOTO[LAc],						c3;


{*****************************************************************************
	GAW Global Address Word    2 clicks
*****************************************************************************}
@GAW:	T ← ib, push, L0←1,					c1, opcode[335'b];
	T ← T LRot8, GOTO[LAWa],					c2;


{*****************************************************************************
	LP Lengthen Pointer	2 click
*****************************************************************************}
@LP:	[] ← TOS, ZeroBr, fXpop, push,				c1, opcode[367'b];
	BRANCH[LPnot, LPnil],						c2;
LPnot:	T ← UvMDS, GOTO[LPTail],					c3;
LPnil:	T ← 0, GOTO[LPTail],						c3;

LPTail:	push, GOTO[LIn],						c1;


{*****************************************************************************
	SLn{n:[0..10]} Store Local n    1 click
*****************************************************************************}
@SL0:	MAR ← Q ← [rhL, L+0], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[31'b];
@SL1:	MAR ← Q ← [rhL, L+1], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[32'b];
@SL2:	MAR ← Q ← [rhL, L+2], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[33'b];
@SL3:	MAR ← Q ← [rhL, L+3], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[34'b];
@SL4:	MAR ← Q ← [rhL, L+4], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[35'b];
@SL5:	MAR ← Q ← [rhL, L+5], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[36'b];
@SL6:	MAR ← Q ← [rhL, L+6], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[37'b];
@SL7:	MAR ← Q ← [rhL, L+7], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[40'b];
@SL8:	MAR ← Q ← [rhL, L+8], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[41'b];
@SL9:	MAR ← Q ← [rhL, L+9], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[42'b];
@SL10:	MAR ← Q ← [rhL, L+0A], L1←L1.Dec, push, GOTO[SLn],	c1, opcode[43'b];

SLn:	MDR ← STK ← TOS, PC ← PC + PC16, pop, IBDisp, BRANCH[SLa,SLb,1],	c2;
SLa:	TOS ← STK, pop, DISPNI[OpTable],				c3;
SLb:	Rx ← UvL, L2←L2.SL, GOTO[LSMap],				c3;


{*****************************************************************************
	SLB Store Local Byte    1 click
*****************************************************************************}
@SLB:	MAR ← Q ← [rhL, L+ib], L1 ← L1.Dec2, push,		c1, opcode[44'b];
SLBx:	MDR ← STK ← TOS, PC ← PC + 1, pop, IBDisp, BRANCH[SLa,SLb,1],	c2;


{*****************************************************************************
	PLn{n:[0..3]} Put Local n    1 click
*****************************************************************************}
{no page carry possible on local 0-3}

@PL0:	MAR ← Q ← [rhL, L+0], fXpop, push, GOTO[PLn],		c1, opcode[55'b];
@PL1:	MAR ← Q ← [rhL, L+1], fXpop, push, GOTO[PLn],		c1, opcode[56'b];
@PL2:	MAR ← Q ← [rhL, L+2], fXpop, push, GOTO[PLn],		c1, opcode[57'b];
@PL3:	MAR ← Q ← [rhL, L+3], fXpop, push, GOTO[PLn],		c1, opcode[60'b];

PLn:	MDR ← TOS, PC ← PC + PC16, IBDisp, CANCELBR[PLa,0],		c2;


{*****************************************************************************
	PLB Put Local Byte    1 click
*****************************************************************************}
@PLB:	MAR ← Q ← [rhL, L+ib], L1 ← L1.PopDec2, push,		c1, opcode[61'b];
PLBx:	STK ← MDR ← TOS, PC ← PC + 1, IBDisp, fXpop, fZpop, BRANCH[PLa,PLb,1],	c2;
PLa:	DISPNI[OpTable],						c3;
PLb:	Rx ← UvL, L2←L2.SL, push, GOTO[LSMap],				c3;


{*****************************************************************************
	SGB Store Global Byte    1 click
*****************************************************************************}
@SGB:	Q ← G + ib, PgCarryBr, L1←L1.Dec2,				c1, opcode[73'b];
	Xbus ← rhG, XwdDisp, push, BRANCH[SGa, SGb],			c2;	{+++ Change for 2M +++}
SGa:	Rx ← UvG, DISP2[SGFix],						c3;	{+++ Change for 2M +++}
SGb:	STK ← TOS, pop, PC ← PC + 1, CANCELBR[SGCross,3],		c3;

SGOK:	MAR ← [rhG, Q+0], GOTO[SLBx],			c1,at[1,4,SGFix];	{+++ Change for 2M +++}

SGFix:	Map ← [rhMDS, Rx],GOTO[SGFix1]			c1,at[0,4,SGFix];	{+++ Change for 2M +++}
	Map ← [rhMDS, Rx],GOTO[SGFix1]			c1,at[2,4,SGFix];	{+++ Change for 2M +++}
	Map ← [rhMDS, Rx],GOTO[SGFix1]			c1,at[3,4,SGFix];	{+++ Change for 2M +++}
SGFix1:	STK ← TOS, pop, PC ← PC + 1,					c2;	{+++ Change for 2M +++}
	rhG ← MD, GOTO[SGCross],					c3;

SGCross:
	Rx ← UvG, L2←L2.SL, GOTO[LSMapx],				c1;


{*****************************************************************************
	SLDn Load Local Double n, n = 0-6,8  2 clicks
*****************************************************************************}
@SLD0:	MAR ← Q ← [rhL, L + 0], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[45'b];
@SLD1:	MAR ← Q ← [rhL, L + 1], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[46'b];
@SLD2:	MAR ← Q ← [rhL, L + 2], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[47'b];
@SLD3:	MAR ← Q ← [rhL, L + 3], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[50'b];
@SLD4:	MAR ← Q ← [rhL, L + 4], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[51'b];
@SLD5:	MAR ← Q ← [rhL, L + 5], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[52'b];
@SLD6:	MAR ← Q ← [rhL, L + 6], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[53'b];
@SLD8:	MAR ← Q ← [rhL, L + 8], L1←L1.PushInc, GOTO[SLDn],	c1, opcode[54'b];

SLDn:	MDR ← TT ← STK, push, BRANCH[SLDa,SLDb,1],			c2;
SLDa:	STK ← TOS, PC ← PC + PC16, L1←L1.PushDec, GOTO[SLDc],		c3;
SLDb:	Rx ← UvL, L2←L2.SLDn, GOTO[SLDe],				c3;

SLDc:	MAR ← Q ← [rhL, Q + 1], pop,					c1;
SLDd:	MDR ← TOS, pop, IBDisp, BRANCH[SLa,SLb,1],			c2;

SLDe:	T ← TOS, GOTO[LSMapx],						c1;

{*****************************************************************************
	SLDB Store Local Double Byte    2 clicks
*****************************************************************************}
@SLDB:	MAR ← Q ← [rhL, L + ib], L1←L1.Push,			c1, opcode[165'b];
	MDR ← STK, push, L2←L2.SLD, BRANCH[SLDBa, SLDBb,1],		c2;
SLDBa:	PC ← PC + 1, STK ← TOS, L1←L1.PushDec2, GOTO[SLDBc],		c3;
SLDBb:	Rx ← UvL, GOTO[LSMap],						c3;

SLDBc:	MAR ← Q ← [rhL, Q + 1], pop, GOTO[SLDd],			c1;


{*****************************************************************************
	PLD0 Put Local Double Zero  2 clicks
*****************************************************************************}
@PLD0:	MAR ← Q ← [rhL, L + 0], fXpop, fZpop, push,		c1, opcode[62'b];
	MDR ← STK,							c2;
	GOTO[@PL1],							c3;


{*****************************************************************************
	PLDB Put Local Double Byte    2 clicks
*****************************************************************************}
@PLDB:	MAR ← Q ← [rhL, L + ib], L1←L1.None,			c1, opcode[63'b];
	MDR ← STK, fXpop, fZpop, push, BRANCH[PLDBa, PLDBb,1],		c2;
PLDBa:	GOTO[PLDB2],							c3;
PLDBb:	Rx ← UvL, L2←L2.PLD, push, GOTO[PLBc],				c3;

PLDB2:	MAR ← Q ← [rhL, Q + 1], push, L1←L1.PopDec2, GOTO[PLBx],	c1;

PLBc:	STK ← T ← TOS, pop, GOTO[LSMapx],				c1;


{*****************************************************************************
	SGDB Store Global Double Byte    2 clicks
*****************************************************************************}
@SGDB:	Q ← G + ib + 1, PgCarryBr, L1←L1.Push,			c1, opcode[166'b];
	Xbus ← rhG, Q ← Q - 1, XwdDisp, push, BRANCH[SGDa, SGDb],	c2;	{+++ Change for 2M +++}
SGDa:	Rx ← UvG, DISP2[SGDc],						c3;	{+++ Change for 2M +++}

SGDc:	Map ← [rhMDS, Rx], L2←L2.SLDx,GOTO[SGDe],	c1,at[0,4,SGDc];	{+++ Change for 2M +++}
	Map ← [rhMDS, Rx], L2←L2.SLDx,GOTO[SGDe],	c1,at[2,4,SGDc];	{+++ Change for 2M +++}
	Map ← [rhMDS, Rx], L2←L2.SLDx,GOTO[SGDe],	c1,at[3,4,SGDc];	{+++ Change for 2M +++}
SGDe:	STK ← TOS,							c2;
	rhG ← MD, GOTO[LSMap],						c3;

SGDd:	MAR ← Q ← [rhG, Q + 0], pop,			c1,at[1,4,SGDc];	{+++ Change for 2M +++}
	MDR ← STK, push,						c2;
	PC ← PC + 1, STK ← TOS, pop,					c3;

	MAR ← [rhG, Q + 1], GOTO[SLDd], L1←L1.PushDec2,			c1;

SGDb:	Rx ← UvG, CANCELBR[$,3],					c3;

	Map ← [rhMDS, Rx], L2←L2.SLDx, GOTO[SGDe],			c1;


{*****************************************************************************
	Load/Store Carry Logic
*****************************************************************************}
LSMap:	T ← TOS, {for SLD and SGD}					c1;
LSMapx:	Q ← Q - Rx, L2Disp,						c2;
	Q ← Q and 0FF, RET[LSRtn],					c3;

LLMap:	Map ← Q ← [rhMDS, Rx+Q],				c1, LSr[L2.LLx];
	GOTO[RMpc3],							c2;

LDMap:	Map ← Q ← [rhMDS, Rx+Q], pop, GOTO[RDMpc2],		c1, LSr[L2.LLDx];

SLMap:	Map ← Q ← [rhMDS, Rx+Q],				c1, LSr[L2.SL];
	T ← TOS, GOTO[WMpc3],					c2;

SDMap:	Map ← Q ← [rhMDS, Rx+Q], pop, GOTO[WDMpc2],		c1, LSr[L2.SLDx];	

SDnMap:	Map ← Q ← [rhMDS, Rx+Q], pop,				c1, LSr[L2.SLDn];	{+++ Change for 2M +++}
	PC ← PC - PC16, pop, GOTO[WDMpc3],			c2;

PDMap:	Map ← Q ← [rhMDS, Rx+Q],				c1, LSr[L2.PLD];	{+++ Change for 2M +++}
	TT ← STK, push, GOTO[WDMpc3],				c2;


	{ E N D }