{ file name: FloatSubs.mc created: T.Tokunaga 28-Mar-85 19:52:40 Last Edited: } { *******************************denormalization code********************* enter with floatTemp,~Q, holding the 32 bit quantity, L0 prepared for return, temp1Low holding shift count note: Q is negatived temp1Low is destroyed denomalized result in floatTemp,Q , and A[15] is sticky bit **************************************************************************} deNormC2: temp1Low _ - temp1Low - 1, c2; deNormA: temp1Low _ temp1Low + 1, NZeroBr, c3; Ybus _ Q and 1, ZeroBr, BRANCH[deNormA1, $], c1; floatTemp _ DRShift1 floatTemp, SE _ 0, BRANCH[deNormA, deNormB], c2; deNormA1: { sticky bit = 0 } Q _ ~ Q, L3Disp, CANCELBR[$], c2; RET[deNormRets], c3; deNormB: { sticky bit will be 1} temp1Low _ temp1Low + 1, NZeroBr, c3; BRANCH[deNormB1, $], c1; floatTemp _ DRShift1 floatTemp, SE _ 0, GOTO[deNormB], c2; deNormB1: Q _ ~Q, L3Disp, c2; Q _ Q or 1, RET[deNormRets], c3; {****************** divide loop *************************************** dividend in divisor in bit count in divCount, performs bitCount subtractions return link = L3 will accumulate bots in divResult, will hold th remainder ************************************************************************} fptDivideLoopC2: Noop, c2; fptDivideLoopC3: divResult _ 0, GOTO[fptDivSubA], c3; {in this part of the loop, the contents of are positive } fptDivSub: Noop, c2; divResult _ LShift1 (divResult), SE _ 1, c3; fptDivSubA: Q _ Q - divisorLow, CarryBr, c1; { subtraction of LawHalf of fractional part } divCount _ divCount - 1, ZeroBr, BRANCH[fptDivSub1, fptDivSub0], c2; fptDivSub0: floatT _ floatT - divisorHigh, CarryBr, BRANCH[$, fptDivSubExit1], c3; {subtraction of highhalf,no borrow from Lowhalf} floatT _ DLShift1 floatT, SE _ 1, { Q.15 _ 0} BRANCH[fptDivAdd, fptDivSub], c1; fptDivSub1: floatT _ floatT - divisorHigh - 1, CarryBr, BRANCH[$, fptDivSubExit2], c3; {subtraction of highhalf, borrow from lowhalf} floatT _ DLShift1 floatT, SE _ 1, {Q.15 _ 0} BRANCH[fptDivAdd, fptDivSub], c1; fptDivSubExit1: BRANCH[fptDivAddExit, fptDivSubExit], c1; fptDivSubExit2: BRANCH[fptDivAddExit, fptDivSubExit], c1; fptDivSubExit: divResult _ LShift1 (divResult), SE _ 1, GOTO[fptDivLoopExit], c2; {In this part of the loop, the contents of are negative ( 2's complement)} fptDivAdd: Noop, c2; divResult _ LShift1 (divResult), SE _ 0, c3; Q _ Q + divisorLow, CarryBr, c1; divCount _ divCount - 1, ZeroBr,BRANCH[fptDivAdd0, fptDivAdd1], c2; fptDivAdd0: floatT _ floatT + divisorHigh, CarryBr, BRANCH[$, fptDivAddExit1], c3; floatT _ DLShift1 floatT, SE _ 1,{Q.15 _ 0}, BRANCH[fptDivAdd, fptDivSub], c1; fptDivAdd1: floatT _ floatT + divisorHigh + 1, CarryBr, BRANCH[$, fptDivAddExit2], c3; floatT _ DLShift1 (floatT), SE _ 1, {Q.15 _ 0} BRANCH[fptDivAdd, fptDivSub], c1; fptDivAddExit1: BRANCH[fptDivAddExit, fptDivSubExit], c1; fptDivAddExit2: BRANCH[fptDivAddExit, fptDivSubExit], c1; {We have subtracted one too many times, so add back in to ger correct remainder } fptDivAddExit: divResult _ LShift1 (divResult), SE _ 0, c2; Q _ Q + divisorLow, CarryBr, c3; BRANCH[fptDivAX0, fptDivAX1], c1; fptDivAX1: floatT _ floatT + divisorHigh + 1, GOTO[fptDivLoopExit], c2; fptDivAX0: floatT _ floatT + divisorHigh, GOTO[fptDivLoopExit], c2; fptDivLoopExit: L3Disp, c3; RET[fptDivLoopRets], c1;