DIRECTORY DragOpsCross USING [XopBase, TrapBase, TrapWidthBytes, bytesPerWord, TrapIndex, Word], --XopBase, TrapBase, TrapWidthBytes, Inst, wordsPerPage, bytesPerWord, charsPerWord, bitsPerByte, bitsPerCharacter, bitsPerWord, logWordsPerPage, logBitsPerByte, logBitsPerChar, logBytesPerWord, logCharsPerWord, logBitsPerWord, logBytesPerPage, PageCount, PageNumber, maxPagesInVM, SixBitIndex, FiveBitIndex, Word, TwoWords, FourBitIndex, Half, ThreeBitIndex, FourHalves, TwoHalves, Byte, ZerosByte, OnesByte, EightBytes, FourBytes, ByteIndex, BytesPerWord, TwoBytes, Comparison, ByteAddress, WordAddress, FieldDescriptor, TrapWidthWords, KernalLimit, TrapIndex, StackUnderflowTrap, IFUPageFaultTrap, ResetTrap, IFUStackOverflowTrap, EUStackOverflowTrap, RescheduleTrap, ALUCondOver, ALUCondBC, ALUCondIL, ALUCondDO, EUPageFault, EUWriteFault, AUFault, euStack, euJunk, euMAR, euField, euConstant, euAux, euBogus, euLast, ifuXBus, ifuStatus, ifuSLimit, ifuYoungestL, ifuYoungestPC, ifuEldestL, ifuEldestPC, ifuBogus, ifuL, ifuS, ifuPC, ifuLast, IFUStatusRec, IFUStackIndex, IFUStackSize, IFUOverflow, EUStackIndex, EUStackSize, EULocalIndex, EULocals, EUAuxIndex, EUAuxRegs, EUConstIndex, EUConstants, IOLocation, ioRescheduleRequest, ioResetRequest DragOpsCrossUtils USING [CardToWord], --BytePCToWordAddress, WordAddressToBytePC, IOOperandToCard, CardToIOOperand, FieldDescriptorToCard, CardToFieldDescriptor, StatusToWord, WordToStatus, BytesToWord, BytesToHalf, WordToBytes, HalfToBytes, HalvesToWord, WordToHalves, HighHalf, LowHalf, LeftHalf, RightHalf, SwapHalves, WordToInt, IntToWord, WordToCard, HalfToCard, ByteToCard, CardToWord, CardToHalf, CardToByte, DragAnd, DragOr, DragXor, DragNot, VanillaAdd, VanillaSub, AddDelta, HalfNot, HalfAnd, HalfOr, HalfXor, HalfShift, DoubleWordShiftLeft, SingleWordShiftLeft, SingleWordShiftRight, TrapIndexToBytePC, XopToBytePC HandCoding, --Has opcode and register defs. HandCodingPseudos, --GenLabel, GenLabelHere, SetLabel, Halt, Pause, MakeLabelGlobal, UseLabel8B, UseLabel16, UseLabel32, ProcedureEntry, ProcedureExit, EnableTraps, IndexedJump, SetupField, ExtractField, ShiftLeft, LoadProcessorReg, StoreProcessorReg, DisableTraps, CauseReschedule, CauseReset, GetSPLimit, SetSPLimit, GetL, SetL, GetYoungestPC, GetYoungestL, GetEldestPC, GetEldestL, SetYoungestPC, SetYoungestL, SetEldestPC, SetEldestL HandCodingSupport; --Area, GetCurrentArea, ReserveData, SetOutputPC, GetProc, PutProc, ProcList, NewArea, GenWithArea, Gen1WithArea, ForceOut, GetOutputPC, WordAlign, OutputByte, OutputOneByte, OutputAlphaBeta, OutputAlphaBetaGammaDelta, OutputWord GenMove: CEDAR PROGRAM IMPORTS DragOpsCrossUtils, HandCoding, HandCodingPseudos, HandCodingSupport = BEGIN OPEN DragOpsCrossUtils, HandCoding, HandCodingPseudos, HandCodingSupport; Word: TYPE = DragOpsCross.Word; All: PROC = { FillXop: PROC [inst: CARDINAL, dest: Label] = { SetOutputPC[inst * DragOpsCross.TrapWidthBytes + DragOpsCross.XopBase * DragOpsCross.bytesPerWord]; drJDB[UseLabel16[dest]]; }; FillTrap: PROC [tx: DragOpsCross.TrapIndex, dest: Label] = { SetOutputPC[LOOPHOLE[tx, CARDINAL] * DragOpsCross.TrapWidthBytes + DragOpsCross.TrapBase * DragOpsCross.bytesPerWord]; drJDB[UseLabel16[dest]]; }; area: Area = GetCurrentArea[]; savePC: LONG CARDINAL; start: Label = GenLabel[]; dummy: Label = GenLabel[]; enterEXDISTest: Label = GenLabel[]; enterDUPTest: Label = GenLabel[]; enterLCTest: Label = GenLabel[]; enterLRTest: Label = GenLabel[]; enterSRTest: Label = GenLabel[]; GenEXDIS: PROC = { ok1: Label _ GenLabel[]; ok2: Label _ GenLabel[]; w: Word _ CardToWord[1]; nw: Word _ CardToWord[37777777776B]; SetLabel[enterEXDISTest]; drLIQB[w]; drLIQB[nw]; drEXDIS[]; drLIQB[nw]; drRJEBJ[left: popSrc, right: belowSrc, dist: UseLabel8B[ok1]]; Pause[]; SetLabel[ok1]; drLIQB[w]; drEXDIS[]; drLIQB[w]; drRJEBJ[left: popSrc, right: belowSrcPop, dist: UseLabel8B[ok2]]; Pause[]; SetLabel[ok2]; }; GenDUP: PROC = { ok1: Label _ GenLabel[]; ok2: Label _ GenLabel[]; w: Word _ CardToWord[2]; nw: Word _ CardToWord[37777777775B]; SetLabel[enterDUPTest]; drLIQB[w]; drDUP[]; drRJEBJ[left: popSrc, right: belowSrcPop, dist: UseLabel8B[ok1]]; Pause[]; SetLabel[ok1]; drLIQB[nw]; drDUP[]; drRJEBJ[left: popSrc, right: belowSrcPop, dist: UseLabel8B[ok2]]; Pause[]; SetLabel[ok2]; }; GenLC: PROC = { ok0: Label _ GenLabel[]; w0: Word _ CardToWord[0]; ok1: Label _ GenLabel[]; w1: Word _ CardToWord[1]; ok2: Label _ GenLabel[]; w2: Word _ CardToWord[2]; ok3: Label _ GenLabel[]; w3: Word _ CardToWord[3]; ok4: Label _ GenLabel[]; w4: Word _ CardToWord[4]; okN2: Label _ GenLabel[]; wN2: Word _ CardToWord[37777777776B]; okN1: Label _ GenLabel[]; wN1: Word _ CardToWord[37777777777B]; okU7: Label _ GenLabel[]; wU7: Word _ CardToWord[100000B]; SetLabel[enterLCTest]; drLC0[]; drLC1[]; drLC2[]; drLC3[]; drLC4[]; drLC5[]; drLC6[]; drLC7[]; drRJEBJ[popSrc, constU7, UseLabel8B[okU7]]; Pause[]; SetLabel[okU7]; drRJEBJ[popSrc, constN1, UseLabel8B[okN1]]; Pause[]; SetLabel[okN1]; drRJEBJ[popSrc, constN2, UseLabel8B[okN2]]; Pause[]; SetLabel[okN2]; drRJEBJ[popSrc, const4, UseLabel8B[ok4]]; Pause[]; SetLabel[ok4]; drRJEBJ[popSrc, const3, UseLabel8B[ok3]]; Pause[]; SetLabel[ok3]; drRJEBJ[popSrc, const2, UseLabel8B[ok2]]; Pause[]; SetLabel[ok2]; drRJEBJ[popSrc, const1, UseLabel8B[ok1]]; Pause[]; SetLabel[ok1]; drRJEBJ[popSrc, const0, UseLabel8B[ok0]]; Pause[]; SetLabel[ok0]; }; GenLR: PROC = { okLR0: Label = GenLabel[]; okLR1: Label = GenLabel[]; okLR2: Label = GenLabel[]; okLR3: Label = GenLabel[]; okLR4: Label = GenLabel[]; okLR5: Label = GenLabel[]; okLR6: Label = GenLabel[]; okLR7: Label = GenLabel[]; okLR8: Label = GenLabel[]; okLR9: Label = GenLabel[]; okLR10: Label = GenLabel[]; okLR11: Label = GenLabel[]; okLR12: Label = GenLabel[]; okLR13: Label = GenLabel[]; okLR14: Label = GenLabel[]; okLR15: Label = GenLabel[]; SetLabel[enterLRTest]; drLIB[4]; drLIB[10B]; drLIB[20B]; drLIB[40B]; drLIB[100B]; drLIB[200B]; drLIDB[400B]; drLIDB[1000B]; drLIDB[2000B]; drLIDB[4000B]; drLIDB[10000B]; drLIDB[20000B]; drLIDB[40000B]; drLIDB[100000B]; drLIQB[CardToWord[200000b]]; drLIQB[CardToWord[400000b]]; drLRn[reg0]; drLRn[reg1]; drLRn[reg2]; drLRn[reg3]; drLRn[reg4]; drLRn[reg5]; drLRn[reg6]; drLRn[reg7]; drLRn[reg8]; drLRn[reg9]; drLRn[reg10]; drLRn[reg11]; drLRn[reg12]; drLRn[reg13]; drLRn[reg14]; drLRn[reg15]; drRJEBJ[popSrc, reg15, UseLabel8B[okLR15]]; Pause[]; SetLabel[okLR15]; drRJEBJ[popSrc, reg14, UseLabel8B[okLR14]]; Pause[]; SetLabel[okLR14]; drRJEBJ[popSrc, reg13, UseLabel8B[okLR13]]; Pause[]; SetLabel[okLR13]; drRJEBJ[popSrc, reg12, UseLabel8B[okLR12]]; Pause[]; SetLabel[okLR12]; drRJEBJ[popSrc, reg11, UseLabel8B[okLR11]]; Pause[]; SetLabel[okLR11]; drRJEBJ[popSrc, reg10, UseLabel8B[okLR10]]; Pause[]; SetLabel[okLR10]; drRJEBJ[popSrc, reg9, UseLabel8B[okLR9]]; Pause[]; SetLabel[okLR9]; drRJEBJ[popSrc, reg8, UseLabel8B[okLR8]]; Pause[]; SetLabel[okLR8]; drRJEBJ[popSrc, reg7, UseLabel8B[okLR7]]; Pause[]; SetLabel[okLR7]; drRJEBJ[popSrc, reg6, UseLabel8B[okLR6]]; Pause[]; SetLabel[okLR6]; drRJEBJ[popSrc, reg5, UseLabel8B[okLR5]]; Pause[]; SetLabel[okLR5]; drRJEBJ[popSrc, reg4, UseLabel8B[okLR4]]; Pause[]; SetLabel[okLR4]; drRJEBJ[popSrc, reg3, UseLabel8B[okLR3]]; Pause[]; SetLabel[okLR3]; drRJEBJ[popSrc, reg2, UseLabel8B[okLR2]]; Pause[]; SetLabel[okLR2]; drRJEBJ[popSrc, reg1, UseLabel8B[okLR1]]; Pause[]; SetLabel[okLR1]; drRJEBJ[popSrc, reg0, UseLabel8B[okLR0]]; Pause[]; SetLabel[okLR0]; }; GenSR: PROC = { okSR0: Label = GenLabel[]; okSR1: Label = GenLabel[]; okSR2: Label = GenLabel[]; okSR3: Label = GenLabel[]; okSR4: Label = GenLabel[]; okSR5: Label = GenLabel[]; okSR6: Label = GenLabel[]; okSR7: Label = GenLabel[]; okSR8: Label = GenLabel[]; okSR9: Label = GenLabel[]; okSR10: Label = GenLabel[]; okSR11: Label = GenLabel[]; okSR12: Label = GenLabel[]; okSR13: Label = GenLabel[]; okSR14: Label = GenLabel[]; okSR15: Label = GenLabel[]; SetLabel[enterSRTest]; drAS[16]; --Skip 16 registers which will be the local registers drLIQB[CardToWord[1000000B]]; drLIQB[CardToWord[2000000B]]; drLIQB[CardToWord[4000000B]]; drLIQB[CardToWord[10000000B]]; drLIQB[CardToWord[20000000B]]; drLIQB[CardToWord[40000000B]]; drLIQB[CardToWord[100000000B]]; drLIQB[CardToWord[200000000B]]; drLIQB[CardToWord[400000000B]]; drLIQB[CardToWord[1000000000B]]; drLIQB[CardToWord[2000000000B]]; drLIQB[CardToWord[4000000000B]]; drLIQB[CardToWord[10000000000B]]; drLIQB[CardToWord[20000000000B]]; drLIB[1]; drLIB[2]; drSRn[reg0]; drSRn[reg1]; drSRn[reg2]; drSRn[reg3]; drSRn[reg4]; drSRn[reg5]; drSRn[reg6]; drSRn[reg7]; drSRn[reg8]; drSRn[reg9]; drSRn[reg10]; drSRn[reg11]; drSRn[reg12]; drSRn[reg13]; drSRn[reg14]; drSRn[reg15]; drAS[16]; drRJEBJ[popSrc, reg0, UseLabel8B[okSR0]]; Pause[]; SetLabel[okSR0]; drRJEBJ[popSrc, reg1, UseLabel8B[okSR1]]; Pause[]; SetLabel[okSR1]; drRJEBJ[popSrc, reg2, UseLabel8B[okSR2]]; Pause[]; SetLabel[okSR2]; drRJEBJ[popSrc, reg3, UseLabel8B[okSR3]]; Pause[]; SetLabel[okSR3]; drRJEBJ[popSrc, reg4, UseLabel8B[okSR4]]; Pause[]; SetLabel[okSR4]; drRJEBJ[popSrc, reg5, UseLabel8B[okSR5]]; Pause[]; SetLabel[okSR5]; drRJEBJ[popSrc, reg6, UseLabel8B[okSR6]]; Pause[]; SetLabel[okSR6]; drRJEBJ[popSrc, reg7, UseLabel8B[okSR7]]; Pause[]; SetLabel[okSR7]; drRJEBJ[popSrc, reg8, UseLabel8B[okSR8]]; Pause[]; SetLabel[okSR8]; drRJEBJ[popSrc, reg9, UseLabel8B[okSR9]]; Pause[]; SetLabel[okSR9]; drRJEBJ[popSrc, reg10, UseLabel8B[okSR10]]; Pause[]; SetLabel[okSR10]; drRJEBJ[popSrc, reg11, UseLabel8B[okSR11]]; Pause[]; SetLabel[okSR11]; drRJEBJ[popSrc, reg12, UseLabel8B[okSR12]]; Pause[]; SetLabel[okSR12]; drRJEBJ[popSrc, reg13, UseLabel8B[okSR13]]; Pause[]; SetLabel[okSR13]; drRJEBJ[popSrc, reg14, UseLabel8B[okSR14]]; Pause[]; SetLabel[okSR14]; drRJEBJ[popSrc, reg15, UseLabel8B[okSR15]]; Pause[]; SetLabel[okSR15]; }; SetLabel[dummy]; Pause[]; Pause[]; Pause[]; Pause[]; Pause[]; Halt[123B]; savePC _ GetOutputPC[area]; FillTrap[ResetTrap, start]; FillXop[0, dummy]; FillXop[377B, dummy]; SetOutputPC[savePC]; WordAlign[area]; SetLabel[start]; --Simulator execution begins here on a Reset. drLIB[1]; drROR[c: const1, a: const0, b: popSrc]; drRVADD[c: const2, a: const1, b: const1]; drRVADD[c: const3, a: const2, b: const1]; drRVADD[c: const4, a: const3, b: const1]; drRVSUB[c: constN2, a: const0, b: const2]; drRVSUB[c: constN1, a: const0, b: const1]; drLIDB[100000B]; drROR[c: constU7, a: const0, b: popSrc]; drASL[255]; GenEXDIS[]; GenDUP[]; GenLC[]; GenLR[]; GenSR[]; Halt[177777B]; --Terminate here at the end of the program }; END. œGenMove.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Edward Fiala February 7, 1986 3:04:22 pm PST This diagnostic tests all move opcodes: EXDIS, DUP, LC0-LC7, LR0-LR15, and SR0-SR15. When correctly executed it terminates with a HALT[177777b] at PC = 4012637B on instruction 140 cycle 293. Xops trap at opcode*TrapWidthBytes + xopBase*bytesPerWord = 4,000,000B + 20B * opcode. A trap's location is TrapIndex*TrapWidthBytes + TrapBase*bytesPerWord = 4,002,000B + 20B * TrapIndex. TrapIndex definitions are in DragOpsCross. In each test, an opcode of type "move" is tested by first loading a value X into the destination and a value X' into the source; then the source is moved to the destination; next, the correct value is loaded onto the stack with LIQB; and finally, the value in the destination is compared to the correct value on the stack with RJEBJ. Then the test is repeated with the value X originally in the source. Test LR0 to LR15. First, push 16 distinctive values onto the stack with LIB, LIDB, and LIQB; the 16 registers containing these values become LR0 to LR15. Then load these values onto the stack using LR0 to LR15. Finally, compare each of the stack values against the value in the local register. S is initially at L-1; push 16 values onto the stack which will become the local registers. Now push the 16 LR's in sequence; then test their values. Opcodes 0 and 377B are intercepted by the simulator, but make them both trap to dummy here anyway. const0 is in a ROM and needs no init. Note that constU7 is used here instead of NSI so that LC7 will be initialized for the test. When there is nothing on the stack, S should be at L-1 ΚΞ–81.25 in leftMargin 1.25 in rightMargin 6.0 in lineLength˜codešœ ™ Kšœ Οmœ7™BK™,K™K™Ώ—K˜šΟk ˜ Kšœ žœEΟcύ˜Τ KšœžœŸΛ˜ρKšœ Ÿ˜+KšœŸ’˜΅KšœŸε˜ψK˜—šœ žœž˜KšžœD˜KKšœžœžœE˜QK˜K–20 sp tabStopsšœžœ˜K˜šΟnœžœ˜ K˜KšœV™Vš œžœžœ˜/Kšœc˜cKšœ˜K˜K˜—Kšœ‘™‘š œžœ.˜