{ File name TextBlt.mc Description: Mesa TextBlt op-code Last edited by Daniels 14-Nov-83 15:43:44: undo previous change. Last edited by Daniels 16-Aug-83 14:03:25: RRot1 uPMask2 due to new PSB format. Last edited by Jim Frandeen February 12, 1982 12:39 PM: Nothing on the Xbus when calling CycleMask; Set L2 _ sd.spec for call to SrcMapSpec. Last edited by Jim Frandeen February 10, 1982 2:31 AM: fix exit bug. Last edited by Jim Frandeen January 7, 1982 1:02 PM: Change to new FontBits format. Last edited by JGS October 5, 1981 3:51 PM: Added Frandeen's fixes. Last edited by JGS 8-Sep-81 7:49:04: New Instruction Set. Last edited by Jim Frandeen August 20, 1981 2:20 PM: Margin is a CARDINAL; Update MicaPos after call to BitBlt in case of page fault. Last edited by Jim August 20, 1981 2:20 PM: Fix for new assembler. Last edited by Jim Frandeen: July 21, 1981 10:50 AM: Test for Resolve before testing for Stop char. Last edited by Jim Frandeen: July 7, 1981 11:06 AM: General rewrite to make it small and wonderful. Last edited by Jim Frandeen: March 17, 1981 4:09 PM: Fix label bug: change tbFunction to tbFunction. Put one on XBus when calling CycleMask. Return with uStack6 in TOS. Last edited by Jim Frandeen: March 16, 1981 2:14 PM: Bug fix: save MicaWidth instead of MicaPos at TestMargin. Change to call TextBltToBitBltEntry instead of LSEPNormEntry. Last edited by Jim Frandeen: March 15, 1981 5:35 PM: Move definitions from Dandelion into TextBlt. Last edited by Jim Frandeen: February 17, 1981 2:55 PM: Change to check for margin before function. Last edited by Jim Frandeen: February 11, 1981 11:04 AM: use symbol to call SavebbRegs. Author: Jim Frandeen Created: December, 1980 } {REGISTER USAGE: Number Name 0 VS holds the Virtual Address when calling SrcMapSpec in BitBlt. TOS used by CycleMask to return cycled result. 1 T temporary used by CycleMask. VD temporary used by DstVAMod subroutine 2 TT temporary Used to hold Index parameter 3 L temporary Used to hold Last parameter. TempBpl used to hold BitPos when calling DstVAMod subroutine 4 G temporary SrcA Used by SrcMapSpec to return real address 5 PC Used by ExtractByte to return value 6 TempB temporary used by DstVAMod subroutine Rx used to hold character MicaPos } {SUBROUTINES } {***************************************************************************** Subroutine FetchVS Fetch word pointed to by Virtual Address in VS and rhVS, offset by T. Store UtbDstLo in UDstVALo to set up for DstVAMod subroutine. Timing: 5 clicks Called from cycle 3, returns to cycle 1 Returns thru L0 Input: VS (TOS) virtual address rhVS (rhMDS) virtual address (high order) T offset of virtual address Output: T word pointed to by Virtual Address SrcA (G) real address page and word rhSrcA (rhG) real address rh USrcValoSav used to save VS Q real page and word rhRet tbMap (used to call SrcMapSpec) *****************************************************************************} MacroDef[FetchVSRet,at[#1,8,FetchVSRet]]; {Return values for FetchVS and ExtractByte Subroutines} {0 = restore.int is reserved for use at tbFaultOrInt} Set[FetchFlags, 1], {fetch RgFlags} {2 = restore.pf is reserved for use at tbFaultOrInt} Set[FetchEntry, 3], {fetch CharEntry} Set[StoreCoord,4], {get address of Coord[Index]} Set[FetchWidth, 5], {fetch width of character} Set[FetchChar, 6], {fetch next character} FetchFontData: VS _ UtbFontCharLo, {Point to CharEntry} c2; rhVS _ UtbFontCharHi, c3; FetchVS: VS _ VS + T, CarryBr, L2 _ sd.spec {in case of fault in SrcMapSpec}, c1; tbFetch: T _ UtbDstLo, BRANCH[$, tbCarry], c2; rhRet _ Fetch, CALL[SrcMapSpec], c3; {SrcMapSpec subroutine here for 2 Clicks, c1-c3;} {On return, SrcA and rhSrcA contain real address.} SrcMapSpecRet[Fetch] MAR _ [rhSrcA, SrcA + 0], c1; UDstVALo _ T {UtbDstLo}, L0Disp, c2; T _ MD, DISP3[FetchVSRet], c3; tbCarry: Q _ rhVS + 1 {Increment rh portion of VA}, LOOPHOLE[byteTiming], c3; rhVS _ Q LRot0, GOTO[tbFetch], c1; {***************************************************************************** Subroutine ExtractByte Extract byte from T depending on Index: Index even => extract left byte index odd => extract right byte Timing: 2 cycles Calling Sequence: ...L0 _ ,... [] _ UtbIndex, XDisp, CALL[ExtractByte], c*; Returns thru L0 Input: T word contains 2 bytes Output: PC word contains left byte or right byte *****************************************************************************} MacroDef[ExtractByteRet,at[#1,8,ExtractByteRet]]; ExtractByte: TT _ T LRot8, L0Disp, BRANCH[tbEvenChar, tbOddChar,0E], c*; tbOddChar: PC _ T and 0FF, DISP3[ExtractByteRet], c*; tbEvenChar: PC _ TT and 0FF, DISP3[ExtractByteRet], c*; {***************************************************************************** Subroutine GgetsBitPos Disp is pending for return *****************************************************************************} Set[Kern,1]; Set[Update,0]; MacroDef[GgetsBitPosRet,at[#1,4,GgetsBitPosRet]]; GgetsBitPos: G _ UtbBitPos, DISP2[GgetsBitPosRet], c*; {***************************************************************************** Subroutine TTgetsSTK Pop stack into TT and set rhType for TextBlt Disp on Stack pointer is pending for return *****************************************************************************} MacroDef[TTgetsSTKRet,at[#1,10,TTgetsSTKRet]]; TTgetsSTK: SavebbRegsRet[Savebb.TXTBLT] TT _ STK, pop, RET[TTgetsSTKRet], c*; {***************************************************************************** Begin TextBlt. Come here from ESC on a Misc 15 opcode. PC points to the byte code because BitBlt counts on this in case of a page fault. Save R and RH registers. Move the parameters passed in the stack to other U registers. If we need to call BitBlt, BitBlt will need to use the stack. Input: stackP = 5 uStack6 = ArgPtr => UtbArgPtr uStack5 = Count => UtbCount uStack4 = MicaPos => UtbMicaPos uStack3 = BitPos => UtbBitPos uStack2 = Index => UtbIndex *****************************************************************************} TextBlt: at[0C,10,ESC2n] ULsave _ L, L2 _ Savebb.TXTBLT, c1; T _ uStack6 {ArgPtr}, CALL[SavebbRegs], c2; {SavebbRegs subroutine here for 2 2/3 Clicks, c3-c1;} {Return to TTgetsSTK} {TT _ STK {Count}, pop {MicaPos: stackP _ 4}, c2;} TTgetsSTKRet[0] UtbCount _ TT {Count}, Xbus _ ErrnIBnStkp, XDisp, CALL[TTgetsSTK], c3; {TT _ STK {MicaPos}, pop {BitPos stackP _ 3}, c1;} TTgetsSTKRet[0B] {1011 is one's complement of stackP = 4} UtbMicaPos _ TT {MicaPos}, {next line} Xbus _ ErrnIBnStkp, XDisp, CALL[TTgetsSTK], c2; {TT _ STK {BitPos}, pop {Index: stackP _ 2}, c3;} TTgetsSTKRet[0C] {1100 is one's complement of stackP = 3} UtbBitPos _ TT {BitPos}, {next line} Xbus _ ErrnIBnStkp, XDisp, CALL[TTgetsSTK], c1; {TT _ STK {Index}, pop {next: stackP _ 1}, c2;} TTgetsSTKRet[0D] {1101 is one's complement of stackP = 2} {Set L2 for SrcMapSpec subroutine in case of a page fault.} UtbIndex _ TT {Index}, L2 _ sd.spec, c3; {***************************************************************************** Move TextBlt arguments pointed to by ArgPtr to U registers. The following loop loads U registers as follows: 60 junk 61 not touched 62 saved and restored 63 UtbFunction: arg word 0 = function 64 UtbLast: arg word 1 = Last 65 UtbTextLo: arg word 2 = TextLo 66 UtbTextHi: arg word 3 = TextHi 67 UtbFontLo: arg word 4 = FontLo 68 UtbFontHi: arg word 5 = FontHi 69 UtbDstLow: arg word 6 = DestLow 6A UtbDstHigh: arg word 7 = DestHigh 6B UtbDstBpl: arg word 8 = DestBpl 6C UtbMargin: arg word 9 = Margin 6D UtbSpace: arg word A = Space 6E UtbCoordLo: arg word B = CoordLo 6F arg word C = junk In case of a page fault, we must be able to restore the stack and the registers. Set rhType to return to us in case of a page fault or interrupt. rhVS = MDS, so we don't need to load it. *****************************************************************************} VS _ UtbArgPtr _ T {ArgPtr}, c1; rhType _ Type.TextBlt, c2; rhRet _ MapArg, CALL[SrcMapSpec], c3; {SrcMapSpec subroutine here for 2 Clicks, c1-c3;} {On return, SrcA (G) and rhSrcA contain real address of TextBltArg.} SrcMapSpecRet[MapArg] L _ UtbFlags , c1; UFlags _ L {UtbFlags -- Set up for BitBlt}, c2; Rx _ uPMask2 {save u62, which will be wiped out}, c3; tbFetchArgLoop: MAR _ [rhSrcA,SrcA ], SrcA _ SrcA + 1, NibCarryBr, c1; Ybus _ SrcA+1, AltUaddr, BRANCH[$, tbFetchFontRecord, 2], c2; tbParmBlock _ Rx, Rx _ MD, GOTO[tbFetchArgLoop], c3; {***************************************************************************** Fetch FontRecord data pointed to by FontLo,,FontHi into U registers. NOTE: for this to work, FontRecord must be hex aligned. The following loop loads U registers as follows: 50 junk 51 UtbFontBitsLo: FontRecord word 0 = FontBitsLo 52 UtbFontBitsHi: FontRecord word 1 = FontBitsHi 53 UtbFontWidthLo: FontRecord word 2 = FontWidthLo 54 UtbFontWidthHi: FontRecord word 3 = FontWidthHi 55 UtbFontCharLo: FontRecord word 4 = FontCharLo {Point to CharEntry} 56 UtbFontCharHi: FontRecord word 5 = FontCharHi 57 UtbFlagsLo: FontRecord word 6 = FlagsLo 58 UtbFlagsHi: FontRecord word 7 = FlagsHi 59 UtbHeight: FontRecord word 8 = Height 5A not touched 5B not touched 5C not touched 5D not touched 5E not touched 5F not touched *****************************************************************************} tbFetchFontRecord: rhRet _ MapFont {NOTE: this instruction follows AltUaddr, so beware of any instruction with a U address here!}, c3; VS _ UtbFontLo, c1; rhVS _ UtbFontHi, c2; Rx _ UtbDstBpl, CALL[SrcMapSpec], c3; {SrcMapSpec subroutine here for 2 Clicks, c1-c3;} {On return SrcA and rhSrcA point to FontRecord.} SrcMapSpecRet[MapFont] tbFetchFontDataLoop: MAR _ [rhSrcA,SrcA+0], c1; Ybus _ SrcA, SrcA _ SrcA+1, YDisp, AltUaddr, c2; UtbFontData _ PC, PC _ MD, {next line} BRANCH[tbFetchFontDataLoop,$,7], c3; {We have just stored UtbFlagsHi, and PC = height (the last parameter)} UtbHeight _ PC, c1; UDstBpl _ Rx {Prepare for BitBlt}, c2; L _ UtbMicaPos, c3; {***************************************************************************** Begin TextBlt loop. We come through here for each character. Subtract Index of current character from index of Last character. If negative, then I'm done. *****************************************************************************} tbSetMicaPos: UtbMicaPos _ L {NewMicaPos}, GOTO[tbLoop], c1; tbLoop: L {Last} _ UtbLast, c2; L _ L {Last} - TT {Index}, UtbIndex _ TT {Index}, NegBr, c3; Xbus _ UtbFunction {test for resolve}, XDisp, BRANCH[$,tbFinished], c1; UDstBit _ 0 {set up for call to DstVAMod for BitBlt}, BRANCH[tbFetchChar, tbResolve, 1], c2; {***************************************************************************** Come here if function is Resolve. Call FetchVS to get real address of Coord[Index]. *****************************************************************************} tbResolve: VS _ UtbCoordLo, c3; rhVS _ UrhMDSsave, c1; T _ UtbIndex, L0 _ StoreCoord, c2; {Put BitPos in L in preparation for write.} L _ UtbBitPos, CALL[FetchVS], c3; {FetchVS subroutine here for 5 clicks, c1-c3} {On return, SrcA and rhSrcA contain real address of Coord[Index].} FetchVSRet[StoreCoord] MAR _ [rhSrcA, SrcA + 0], c1; MDR _ L {bitPos}, c2; tbFetchChar: Rx _ UtbMicaPos {Prepare for tbTestMargin}, c3; {FetchText[Index]: word that contains next character.} VS _ UtbTextLo, L0 _FetchChar, c1; rhVS _ UtbTextHi, c2; T {offset} _ RShift1 TT {Index}, CALL[FetchVS], c3; {FetchVS subroutine here for 5 clicks, c1-c3} {On return, T contains word that contains next character.} tbJustify: FetchVSRet[FetchChar] Xbus _ UtbIndex, XDisp, CALL[ExtractByte], c1; {ExtractByte subroutine here c2-c3} {On return, PC contains next character} ExtractByteRet[FetchChar] Rx _ UtbMicaPos {Prepare for tbTestMargin}, c1; tbFetchFlags: {Fetch RgFlags[char/8]. } VS _ UtbFlagsLo, L0 _FetchFlags, c2; rhVS _ UtbFlagsHi, c3; T _ LShift1 (PC {next char} and 0F8) {mask off low 3 bits}, c1; T _ T LRot12 {Char/8}, c2; {Prepare L for CycleMask below.} L _ LShift1 (PC {next char} and 7), CALL[FetchVS], c3; {FetchVS subroutine here for 5 clicks, c1-c3} {***************************************************************************** On return, T contains RgFlags[char/8]. Call CycleMask to right justify RgFlags. We rotate RgFlags 2*(n+1), where n is the low 3 bits of Char. If n = 7, our Disp4 will cause a zero rotation. Calling sequence to CycleMask: T = data to be rotated (RgFlags) TT = pre-rotated version of T We must set INIA.11. *****************************************************************************} FetchVSRet[FetchFlags] Ybus _ L {LShift1 (nextChar and 7)} + 2, YDisp, L2 _ maskRet.flags, c1; TT _ LRot1 T {RgFlags}, DISP4[CycleMask], c2; {CycleMask subroutine here for 1 click, c3-c2} {On return, TOS contains RgFlags right justified. } tbTestStop: {Dispatch on low order bit to test for Stop character.} at[maskRet.flags,10,MaskRet] UtbRgFlags _ TOS, L0 _ FetchWidth, YDisp, c3; T {char/2} _ RShift1 PC {nextChar}, {next line} BRANCH[tbFetchWidth,tbStopChar,0E], c1; tbFetchWidth: {Fetch width of character from FontWidth record[char/2] } VS _ UtbFontWidthLo, c2; rhVS _ UtbFontWidthHi, CALL[FetchVS], c3; {FetchVS subroutine here for 5 clicks, c2-c3} {On return, T contains word that contains width of character. } FetchVSRet[FetchWidth] Ybus _ L _ PC {nextChar}, YDisp, CALL[ExtractByte], c1; {ExtractByte subroutine here, c2-c3} {On return, PC contains width of Char, L contains char} ExtractByteRet[FetchWidth] TOS {height} _ UtbHeight, c1; UHeight _ TOS {UtbHeight -- Prepare for BitBlt}, L0 _ FetchEntry, c2; T _ LShift1 L {nextChar}, c3; {Fetch CharEntry[2*Char] to get offset into font table.} L {Margin} _ UtbMargin {Prepare for TestMargin.} {next line}, CALL[FetchFontData], c1; {FetchVS subroutine here for 5 2/3 clicks, c2-c3} {***************************************************************************** On return, T contains CharEntry[2*Char]. This contains the left and right kern bits and the offset of the character in the font table. Start read of second word of CharEntry (Mica width). Set Flags: direction: forward, disjoint: TRUE, disjointItems: TRUE, gray: FALSE, srcFunc: null, dstFunc: or NOTE: For this to work, FontChar must be doubleword aligned; otherwise we would have to worry about a page fault on the second word. *****************************************************************************} FetchVSRet[FetchEntry] MAR _ [rhSrcA, SrcA + 1], c1; UtbWidth _ PC, CANCELBR[$,0], c2; TT {MicaWidth} _ MD, c3; {TT = MicaWidth for this char. If micaPos + MicaWidth > margin THEN GOTO tbMargin.} tbTestMargin: {Rx = UtbMicaPos L = UtbMargin} TOS {SrcHi} _ rhVS _ UtbFontBitsHi {Prepare for Display}, c1; TT {new MicaPos} _ Rx {MicaPos} + TT {MicaWidth}, c2; L {we must write rB to use A bypass} _ L {Margin} - TT {MicaPos + MicaWidth}, CarryBr, c3; {IF micaPos + MicaWidth > margin THEN GOTO tbMargin Note that margin is a CARDINAL and can take up 16 bits, so we must check for carry, not negative.} Xbus _ UtbFunction, XDisp, BRANCH[tbMargin,$], c1; UtbNewMicaPos _ TT, DISP2[tbFunction], c2; {***************************************************************************** Come here if function is Display. L2 = OffsetPlus256 TOS = rhVS = UtbFontBitsHi PC = UtbWidth = width of character T = offset to FontTable in low 14 bits. T = left kern in bit 0. T = right kern in bit 1. Set up parameters for BitBlt: L2 = sd.spec UDstBpl contains dstBpl UWidth contains width of Char UFlags contains flags USrcBpl contains srcBpl (width of character) UHeight contains height (from FontRecord) UDstValo contains low order of dest BitAddress UDstBit contains bit portion of dest BitAddress USrcValo contains low order of source BitAddress USrcBit contains bit portion of source BitAddress (Zero) UrhVS and rhVS contain high order of source BitAddress UrhVD and rhVD contain high order of dest BitAddress *****************************************************************************} {Calculate source address for BitBlt. Extract offset to FontTable from low 14 bits of first word of CharEntry. Calculate address of entry for this Char in FontTable: FontChar + offset.} tbDisplay: at[0,4,tbFunction] TT {offset} _ T {CharEntry} and u3FFF, {nextLine}, c3; L {Src} _ UtbFontBitsLo, c1; L {Src} _ L {Src} + TT {offset}, CarryBr, c2; tbTestFontCarry: USrcVALo _ L {Src}, BRANCH[tbNoFontCarry, tbFontCarry], c3; tbFontCarry: TOS {SrcHi} _ TOS + 1, c1; rhVS {SrcHi} _ TOS LRot0, GOTO[tbTestFontCarry], c2; tbNoFontCarry: UrhVS _ TOS {SrcHi}, TOS _ 0, c1; USrcBit _ TOS {0}, TOS _ {8000} RShift1 TOS, SE _ 1, c2; {Extract left kern and right kern bits.} L {LKern} _ LRot1 T {Left kern in low order bit}, c3; TOS {RKern} _ (L LRot1) and TOS {8000}, c1; L {LKern} _ L {LKern} and 1 , c2; {Calculate Width as Width + left kern + right kern.} PC {Width} _ PC {Width} + L {LKern}, c3; TOS {Width} _ PC {Width} + TOS {RKern}, L0 _ Kern, c1; USrcBpl _ TOS {Width}, c2; UWidth _ TOS {Width}, L0Disp, CALL[GgetsBitPos], c3; {Calculate bitPos as bitPos - left kern.} {G _ UtbBitPos, c1;} GgetsBitPosRet[Kern] L {BitPos} _ G {UtbBitPos} - L {LKern}, rhWho _ Dest, c2; {***************************************************************************** Calculate Dst address for BitBlt. Call DstVAMod to add BitPos to Dst address. Parameters must be set up as follows: rhWho caller TempBpl increment for the destination address (L) UDstValo virtual destination page and word, set from UtbDstLo by FetchVA UDstBit virtual destination bit (set to 0) UrhVD virtual destination rh *****************************************************************************} T _ UtbDstHi, rhVD _ UtbDstHi, c3; tbCalculateDst: UrhVD _ T, CALL[DstVAMod], c1; {DstVAMod subroutine here for 4 clicks, c2 - c1} {On return, uDstValo has been updated by the number of words in BitPos. TempB and UDstBit contain BitPos. We must mask off the high order bits of BitPos from UDstBit.} DstVAModRet[Dest] TempB {BitPos} _ TempB and 0F, L2 _ sd.spec, c2; UDstBit _ TempB, CALL[TextBltToBitBltEntry], c3; {BitBlt runs here for lots of clicks., c1 - c2} {***************************************************************************** Return here from BitBlt. L0 = restore.term. Increment BitPos. *****************************************************************************} tbNextChar: at[6,8,LSEPReturn] T _ UtbWidth {width}, {0 disp}, CALL[GgetsBitPos], c3; {G _ UtbBitPos GOTO[tbNextCharx], c1;} {***************************************************************************** Come here if function is Resolve. *****************************************************************************} at[2,4,tbFunction] T _ UtbWidth {width}, {0 disp}, CALL[GgetsBitPos], c3; {G _ UtbBitPos GOTO[tbNextCharx], c1;} tbNextCharx: GgetsBitPosRet[Update] G {BitPos} _ G {BitPos} + T {Width}, {next line} Xbus _ UtbRgFlags, XDisp, {Test for pad character (2 bit of RgFlags).} c2; tbTestPad: {Come here from tbCountPos or tbCountNotPos to delay 1 cycle.} TT {Count} _ UtbCount, BRANCH[tbNoPad,tbPad,0D], c3; tbPad: T {Count} _ TT {Count} + 1, c1; Xbus _ UtbFunction, XLDisp, {test low order bit: 1 if format} c2; {Test for function = format. 0 => display, 1 => format, 2=> resolve.} UtbCount _ T {Count}, TT _ TT {count-1}, NegBr, {next line} BRANCH[$,tbNoPad], c3; {Continue if function is not Format. Increment BitPos by Space. If count <= 0, increment BitPos by one more.} T _ UtbSpace, BRANCH[tbCountPos, tbCountNotPos], c1; tbCountPos: G {BitPos} _ G {BitPos} + T {Space}, GOTO[tbTestPad], c2; tbCountNotPos: G {BitPos} _ G {BitPos} + T {Space} + 1, GOTO[tbTestPad], c2; tbNoPad: L _ UtbNewMicaPos, CANCELBR[$,1], c1; {Increment Index and continue loop.} TT {Index} _ UtbIndex, c2; UtbBitPos _ G {BitPos}, TT {Index} _ TT {Index} + 1, GOTO[tbSetMicaPos], c3; {***************************************************************************** Come here if function is Format. *****************************************************************************} tbFormat: at[1,4,tbFunction] T _ UtbWidth {width}, {0 disp}, CALL[GgetsBitPos], c3; {G _ UtbBitPos, GOTO[tbNextCharx], c1;} tbFinished: TOS _ 0 {normal}, CANCELBR[tbDone,3], L0 _ restore.term, c2; tbMargin: TOS _ 1 {margin}, CANCELBR[tbDone,3], L0 _ restore.term, c2; tbStopChar: TOS _ 2 {stop}, L0 _ restore.term, GOTO[tbDone], c2; {***************************************************************************** Come here from BitBlt if we get a page fault (L0 = restore.pf) or a request for an interrupt (L0 = restore.int). Restore the Stack so that it will be set up when our opcode gets executed again. Then go to RestoreRandRHRegs subroutine, which will return to the appropriate place in BitBlt. *****************************************************************************} at[7,8,MoverhVToStkandRestore] TOS _ UtbArgPtr, c2; Noop, c3; tbFault: Noop, c1; {***************************************************************************** Subroutine RestoreStack Timing: 3 2/3 cycles Input: T value to place in Stack6 Restore the Stack with TextBlt parameters. We do this at completion, to process an interrupt, or to process a page fault. We then exit to RestoreRandRHRegs, which will return to the appropriate place in BitBlt. On completion, we must come here on c3. On interrupt or page fault, we must come here on c2. *****************************************************************************} {fin int} tbDone: uStack6 _ TOS, TT _ 0, c*; {c3 c2} tbRestoreStack: stackP _ TT {0}, T _ UtbIndex, c*; {c1 c3} uStack2 _ T, c*; {c2 c1} T _UtbBitPos, push {stackP _ 1}, c*; {c3 c2} uStack3 _ T, push {stackP _ 2}, c*; {c1 c3} T _ UtbMicaPos, push {stackP _ 3}, c*; {c2 c1} uStack4 _ T, push {stackP _ 4}, c*; {c3 c2} T _ UtbCount, push {stackP _ 5}, c*; {c1 c3} uStack5 _ T, GOTO[RestoreRandRHRegs], c*; {c2 c1} {RestoreRandRHRegs here 2 1/3 cycles} {c3 - c3 c2 - c2} {Continue at BBExit on c1 if finished (L0 = restore.term)} {Continue at restore.pf on c3 if page fault (L0 = restore.pf)} {Continue at restore.int on c3 if interrupt (L0 = restore.int)} {END}