{	NLispUnboxed.mc }


{	in bank 1
@UNBOX1:	opcode[354'b],
	Bank ← LUBank, L0 ← L0.UnBoxed,	c1;
	uTOS ← TOS,	c2;
	uTOSH ← TOSH, CROSS[UB1Start],	c3;

@UNBOX2:	opcode[355'b],
	Bank ← LUBank, L0 ← L0.UnBoxed,	c1;
	uTOS ← TOS,	c2;
	uTOSH ← TOSH, CROSS[UB2Start],	c3;
	end in bank 1 }

	at[UB2Start],
	Xbus ← ibNA, XDisp, L3 ← L3.UB2Q2,	c1;
	Q ← 0FF, DISP4[ub2op],	c2;

	L2 ← L2.Fplus,	c3, at[ib.UF2.add, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	L2 ← L2.Fdiff,	c3, at[ib.UF2.sub, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	L2 ← L2.Fidiff,	c3, at[ib.UF2.isub, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	L2 ← L2.Ftimes,	c3, at[ib.UF2.mult, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	TT ← TOSH LRot1, L2 ← L2.Fquot, GOTO[ub2Qcont2]	c3, at[ib.UF2.div, 10, ub2op];

	L2 ← L2.Fgreat,	c3, at[ib.UF2.great, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	L2 ← L2.Fmax,	c3, at[ib.UF2.max, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

	L2 ← L2.Fmin,	c3, at[ib.UF2.min, 10, ub2op];
	MAR ← [rhS, S - 1], GOTO[ub2cont],	c1;

{	MAR ← [rhS, S - 1],	c1; }
ub2cont:
	uArg2Hi ← TOSH, CANCELBR[$, 2],	c2;
	TOSH ← MD,	c3;

	MAR ← [rhS, S + 0], L0 ← L0.UnBoxed,	c1;
	uArg2Lo ← TOS, CANCELBR[$, 2],	c2;
	TOS ← MD,	c3;

	Rx ← 0FF + 1, GOTO[fptprep],	c1;

	{ quotient stuff }
	at[L3.UB2Q2, 10, fptQ2ret],
	Rx ← TT LRot8 and Q, {exponent}, GOTO[ub2Qcont1],	c1;

	at[L3.FunUFirst, 10, fptQdone],
	Xbus ← ib, GOTO[c1.pc2B2],	c3;

{	in bank 1
@UNBOX1:	opcode[354'b],
	Bank ← LUBank, L0 ← L0.UnBoxed,	c1;
	uTOS ← TOS,	c2;
	uTOSH ← TOSH, CROSS[UB1Start],	c3;
	end bank 1 }

	at[UB1Start],
	Xbus ← ibNA, XDisp,	c1;
	DISP4[UB1fn], FloatNop,	c2;

		{unboxed to boxed}
	at[ib.UF1.utob, 10, UB1fn],
	uNewValLo ← TOS, L1 ← L1.fixFV,	c3;

	Bank ← EmuBank,	c1;
	uNewValHi ← TOSH, L3 ← L3.utob,	c2;
	Q ← LS4FptType, CROSS[CCEntry],	c3;

		{abs of unboxed}
	at[ib.UF1.abs, 10, UB1fn],
	Rx ← RShift1 Rx xor ~Rx, SE ← 0,	c3;

	TOSH ← TOSH and Rx,	c1;
UBSend:
	Xbus ← ib,	c2;
	GOTO[c1.pc2B2],	c3;

		{neg of unboxed}
	at[ib.UF1.neg, 10, UB1fn],
	Rx ← RShift1 0, SE ← 1,	c3;

	TOSH ← TOSH xor Rx, GOTO[UBSend],	c1;
 
		{boxed to unboxed}
	at[ib.UF1.btou, 10, UB1fn],
	L3 ← L3.btou, FloatNop,	c3;

	FloatNop,	c1;
	CALL[FloatIt],	c2;

	at[L3.btou, 10, FloatItRet],
	Xbus ← ib,	c1;
	,	c2;
	GOTO[c1.pc2B2].	c3;