{File name: XMesa.df
 Description: Non-Register Definitions for Dandelion Mesa Emulator Microcode,
 Created: November 18, 1980,
 Last Edited:
Jim Sandman October 14, 1981  3:59 PM: Change for new instruction set
Jim Frandeen March 11, 1981  2:56 PM: Change BLDest and BLDestR for Checksum
Jim Frandeen March 4, 1981  4:55 PM: Add entry to RMapFixCaller
Jim Frandeen February 17, 1981  5:02 AM: changes to RMapFixCaller, WMapFixCaller, RFixForTrap, WFixForTrap for new Block
Sandman, February 2, 1981  1:11 PM
Sandman, January 20, 1981  4:48 PM
Jim Frandeen January 8, 1981  10:41 AM
}


Set[pFault, 3]; {also in Process}{BB}

Set[pInt, 47]; {also in Process}{BB}


{L2	MaskRet}

Set[maskRet.fQ, 9 ],{BB}
Set[maskRet.f1, 0E],{BB}
Set[maskRet.f2, 0D],{BB}
Set[maskRet.bQ, 0C],{BB}
Set[maskRet.b1, 0B],{BB}
Set[maskRet.b2, 0A],{BB}

Set[OpcodeBase, 500];

MacroDef[opcode, at[Add[#1, OpcodeBase]]];

MacroDef[AlwaysIBDisp, (IBDisp, IBPtr←1)];


{Block and BitBlt stuff}

Set[Savebb.BANDBLT,0C]; {Return from SavebbRegs for BandBlt}

{constant and macro definitions for BitBlt}

		{gray (gr) values}
Set[gr.gray,1],Set[gr.notgray,5],Set[gr.mask,1],Set[grM,8],{BB}

		{source function (sf) values}
Set[sf.true,4],Set[sf.comp,5],Set[sf.mask,4],Set[sfM,8],{BB}

		{direction (dir) values}
Set[dir.forward,6],Set[dir.backwards,0E],Set[dirM,10],{BB}

		{dest function (df) values}
Set[df.null,8],Set[df.and,0A],Set[df.or,0C],Set[df.xor,0E],Set[dfM,10],{BB}

		{srcdst function (sd) values}
Set[sd.src,0],Set[sd.dst,1],Set[sd.spec,2],Set[sdM,4],{BB}

{Return points for RestoreRandRHRegs}
Set[restore.term, Sub[grM,1] ],{MUST BE Sub[grM,1]}{BB}
Set[restore.int, 0 ],{restore if interrupt }{BB}
Set[restore.pf, 2 ],{restore if page fault}{BB}


{Return points for DstVAMod}
MacroDef[DstVAModRet,at[#1,4,DstVAModRet]];
Set[sdWidth, 2 ],{for DstVAMod and SrcVAMod}{BB}
Set[sdBpl, 1 ],{ DstVAMod and SrcVAMod}{BB}

{Return points for SrcMap}
MacroDef[SrcMapSpecRet,at[#1,10,SrcMapRet]];
Set[argMap, 1 ],{for mapping BitBltArg}{BB}
Set[sdMap, 0 ],{for SrcMap and DstMap}{BB}
Set[MapOne, 2 ],{for SrcMap and DstMap}{BB}


Set[hbs.0, Or[ Xor[0F, 0] , 6 ] ],
Set[hbs.1, Or[ Xor[0F, 1] , 6 ] ],
Set[hbs.2, Or[ Xor[0F, 2] , 6 ] ],{BB}
Set[hbs.A, Or[ Xor[0F, 0A] , 6 ] ],
Set[hbs.B, Or[ Xor[0F, 0B] , 6 ] ],
Set[hbs.C, Or[ Xor[0F, 0C] , 6 ] ],{BB}
Set[hbs.D, Or[ Xor[0F, 0D] , 6 ] ],{BB}

MacroDef[scDisp,L0Disp],{BB}
MacroDef[dfDisp,L1Disp],{BB}
MacroDef[dirDisp,L1Disp],{BB}
MacroDef[sdDisp,L2Disp];{BB}
MacroDef[sfDisp,L3Disp],{BB}
MacroDef[grDisp,L3Disp],{BB}

MacroDef[sc1DISP,DISP4[#1,0E]],{BB}
MacroDef[sc2DISP,DISP4[#1,03]],{BB}
MacroDef[sc3DISP,DISP4[#1,0D]],{BB}
MacroDef[dirDISP,DISP4[#1,6]],{BB}
MacroDef[dfDISP,DISP4[#1,8]],{BB}
MacroDef[sfDISP,DISP3[#1,sf.mask]],{BB}
MacroDef[grDISP,DISP3[#1,gr.mask]],{BB}
MacroDef[sdDISP,DISP2[#1]],{BB}

Set[SRaRet, 2 ],{rhRet value for SrcLRemap}
Set[SRcRet, 3 ],{rhRet value for SrcLRemap}

Set[DRaRet, 02 ],{rhRet value for DstLRemap}
Set[DRbRet, 03 ],{rhRet value for DstLRemap}
Set[ret.L1pcr, 08 ],{rhRet value for DstLRemap}
Set[ret.L2pcr, 09 ],{rhRet value for DstLRemap}
Set[ret.L1Tpcr, 0A ],{rhRet value for DstLRemap}

Set[StkSize.normal, 1 ],{used for HowBigStack}
Set[StkSize.interrupt, 7 ],{used for HowBigStack}

Set[Type.normal, 0 ],{value in rhType}{BB}
Set[Type.LSEP, 1 ],{value in rhType}
Set[Type.TextBlt,4], {value in rhType tells what to do if page fault}
Set[type.notsmall,7],Set[type.small,5],Set[typeM,8],{BB}

Set[dtRet.L0, 0 ],{constant value for dT}{BB}
Set[dtRet.L1, 1 ],{constant value for dT}{BB}
Set[dtRet.L3, 3 ],{constant value for dT}{BB}
Set[dtRet.L4, 4]{used by BandBLT for dT};

Set[VAaRet, 0 ],{rhRet value for VAModSub}{even, < 8}{BB}
Set[VAbRet, 2 ],{rhRet value for VAModSub}{even, < 8}{BB}
Set[srcTP, 4 ],{rhRet value for VAModSub}{even, < 8}
Set[dstTP, 6 ],{rhRet value for VAModSub}{even, < 8}

Set[NoPgCr, 0 ],
Set[PgCr, 2 ],
Set[LCeq0, 1 ],

Set[dbsb0, 0 ],{BB}
Set[sbneq0, 1 ],{BB}
Set[dbneq0, 3 ],{BB}
;
	{ E N D }