<> <> <> <> <> <<>> <> DIRECTORY Basics USING [BITAND], DebuggerDefs, DragOpsCross USING [], --Word, wordsPerPage, bytesPerWord, charsPerWord, bitsPerByte, bitsPerCharacter, bitsPerWord, bytesPerPage, logWordsPerPage, logBitsPerByte, logBitsPerChar, logBytesPerWord, logCharsPerWord, logBitsPerWord, logBytesPerPage, PageCount, PageNumber, maxPagesInVM, SixBitIndex, FiveBitIndex, TwoWords, FourBitIndex, Half, ThreeBitIndex, FourHalves, TwoHalves, Byte, ZerosByte, OnesByte, EightBytes, FourBytes, ByteIndex, BytesPerWord, TwoBytes, Comparison, ByteAddress, WordAddress, FieldDescriptor, RegIndex, PadByte, Lit8, Op4, Op8, JDist8, Inst, OIFormat, OQBformat, LRformat, QRformat, ShortRegQR, OBformat, LRBformat, RRformat, ODBformat, LRRBformat, RJBformat, ShortRegRJB, JBBformat, TrapWidthWords, TrapWidthBytes, XopBase, TrapBase, KernalLimit, TrapIndex, StackUnderflowTrap, IFUPageFaultTrap, ResetTrap, IFUStackOverflowTrap, EUStackOverflowTrap, RescheduleTrap, ALUCondFalse, ALUCondEZ, ALUCondLZ, ALUCondLE, ALUCondSpare, ALUCondNE, ALUCondGE, ALUCondGZ, ALUCondOver, ALUCondBC, ALUCondIL, ALUCondDO, ALUCondNotOver, ALUCondNB, ALUCondNI, ModeFault, MemAccessFault, IOAccessFault, EUPageFault, EUWriteFault, AUFault, euStack, euJunk, euToKBus, euMAR, euField, euConstant, euAux, euBogus, euLast, ifuYoungestL, ifuYoungestPC, ifuEldestL, ifuEldestPC, ifuSLimit, ifuBogus, ifuL, ifuS, ifuPC, ifuLast, EURegs, EULegalRegs, IFURegs, IFULegalRegs, StackedStatusWord, IFUStackIndex, IFUStackSize, IFUOverflow, EUStackIndex, EUStackSize, EULocalIndex, EULocals, EUAuxIndex, EUAuxRegs, EUConstIndex, EUConstants, IOLocation, ioRescheduleRequest, ioResetRequest, IOOperand, PCmdFormat, PCmdByteSelect, PCmdClass, PCmdSpace, PCmdDirection DragOpsCrossUtils USING [CardToWord], --InstToBytes, InstToFormat, BytePCToWordAddress, WordAddressToBytePC, IOOperandToCard, CardToIOOperand, FieldDescriptorToCard, CardToFieldDescriptor, 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, XopToBytePC, TrapIndexToBytePC, FieldUnit HandCoding, --Has opcode and register defs. HandCodingPseudos, --Label, SetLabel, GenLabel, GenLabelHere, UseLabel8A, UseLabel8B, UseLabel16, UseLabel32, LReg, PReg, SReg, AddReg, SubReg, SetRegConst, MoveReg, MoveRegI, LRegI, IndexedJump, ProcedureEntry, ProcedureExit, SetupField, ExtractField, ShiftLeft, LoadProcessorReg, StoreProcessorReg, CauseReschedule, CauseReset, GetSPLimit, SetSPLimit, GetYoungestPC, GetYoungestStatus, GetEldestPC, GetEldestStatus, SetYoungestPC, SetYoungestStatus, SetEldestPC, SetEldestStatus, Pause, Halt HandCodingSupport; --Area, GetProc, PutProc, ProcList, NewArea, GenWithArea, Gen1WithArea, ForceOut, GetCurrentArea, LoadArea, GetOutputPC, SetOutputPC, WordAlign, ReserveData, OutputByte, OutputOneByte, OutputAlphaBeta, OutputAlphaBetaGammaDelta, OutputWord GenJumpTest: CEDAR PROGRAM IMPORTS Basics, DragOpsCrossUtils, HandCoding, HandCodingPseudos, HandCodingSupport = BEGIN OPEN DebuggerDefs, DragOpsCrossUtils, HandCoding, HandCodingPseudos, HandCodingSupport; All: PROC = { area: Area = GetCurrentArea[]; enterJQBTest: Label = GenLabel[]; enterJDBTest: Label = GenLabel[]; enterJBTest: Label = GenLabel[]; enterJnTest: Label = GenLabel[]; <> GenJDB: PROC = { <> DoJDB: PROC [disp: INTEGER] = { oldPC: LONG CARDINAL _ GetOutputPC[area]; drJDB[LOOPHOLE[disp, CARDINAL]]; SetOutputPC[oldPC + LONG[disp]]; }; SetLabel[enterJDBTest]; --Begin at userBasePC (DebuggerDefs.mesa) = 4040000B <> DoJDB[ 4001B]; --PC => 4044001B DoJDB[ 10002B]; --PC => 4144003B DoJDB[ 20004B]; --PC => 4344007B DoJDB[ 40010B]; --PC => 4744017B DoJDB[ 20B]; --PC => 4744037B DoJDB[ 40B]; --PC => 4744077B DoJDB[ 100B]; --PC => 4744177B DoJDB[ 200B]; --PC => 4744377B DoJDB[ 400B]; --PC => 4744777B DoJDB[ 1000B]; --PC => 4745777B DoJDB[ 2000B]; --PC => 4747777B DoJDB[ 10000B]; --PC => 4757777B DoJDB[ 20000B]; --PC => 4777777B drJ1[]; --PC => 5000000B <> DoJDB[ 40000B]; --PC => 5040000B DoJDB[ 20000B]; --PC => 5060000B DoJDB[ 10000B]; --PC => 5070000B DoJDB[ 4000B]; --PC => 5074000B DoJDB[ 2000B]; --PC => 5076000B DoJDB[ 1000B]; --PC => 5077000B DoJDB[ 400B]; --PC => 5077400B DoJDB[ 200B]; --PC => 5077600B DoJDB[ 100B]; --PC => 5077700B DoJDB[ 40B]; --PC => 5077740B DoJDB[ 20B]; --PC => 5077760B DoJDB[ 10B]; --PC => 5077770B DoJDB[ 10B]; --PC => 5100000B** DoJDB[ 14B]; --PC => 5100014B DoJDB[ 22B]; --PC => 5100036B DoJDB[ 41B]; --PC => 5100077B <<**Note that the Mesa compiler gives an overflow when -100000B is used below.>> <> DoJDB[-77777B-1]; --PC => 5000077B DoJDB[-77777B-1]; --PC => 4700077B DoJDB[40400B]; --PC => 4740477B DoJDB[40400B]; --PC => 5301077B }; <> GenJn: PROC = { SetLabel[enterJnTest]; drJ1[]; --5301077B to 5301100B drJ2[]; Pause[]; --5301102B drJ3[]; Pause[]; Pause[]; --5301105B drJ5[]; Pause[]; Pause[]; Pause[]; Pause[]; --5301112B }; <> GenJB: PROC = { <> DoJB: PROC [disp: INTEGER] = { oldPC: LONG CARDINAL _ GetOutputPC[area]; drJB[Basics.BITAND[LOOPHOLE[disp, CARDINAL], 377B]]; SetOutputPC[oldPC + LONG[disp]]; }; SetLabel[enterJBTest]; DoJB[100B]; --PC => 5301212B DoJB[ 40B]; --PC => 5301252B DoJB[ 20B]; --PC => 5301272B DoJB[ 10B]; --PC => 5301302B DoJB[ 44B]; --PC => 5301346B DoJB[ 42B]; --PC => 5301410B DoJB[ 41B]; --PC => 5301451B DoJB[-140B]; --PC => 5301311B }; <> GenJQB: PROC = { <> DoJQB: PROC [destPC: LONG CARDINAL] = { drJQB[CardToWord[destPC]]; SetOutputPC[destPC]; }; SetLabel[enterJQBTest]; <> DoJQB[ 5400000B]; DoJQB[ 5400010B]; DoJQB[ 5400030B]; DoJQB[ 5400070B]; DoJQB[ 5400170B]; DoJQB[ 5400270B]; DoJQB[ 5400670B]; DoJQB[ 5400770B]; DoJQB[ 5401772B]; DoJQB[ 5403772B]; DoJQB[ 5407772B]; DoJQB[ 5417776B]; DoJQB[ 5437776B]; DoJQB[ 5477776B]; DoJQB[ 5500101B]; DoJQB[ 5700000B]; DoJQB[ 6000000B]; DoJQB[ 7000000B]; IF NOT withSoftCard THEN { DoJQB[ 10000000B]; DoJQB[ 20000000B]; DoJQB[ 40000000B]; DoJQB[ 100000000B]; DoJQB[ 200000000B]; DoJQB[ 400000000B]; DoJQB[ 1000000000B]; DoJQB[ 2000000000B]; DoJQB[ 4000000000B]; DoJQB[10000000000B]; DoJQB[20000000000B]; }; DoJQB[ 7777770B]; }; <> GenJDB[]; GenJn[]; GenJB[]; GenJQB[]; Halt[177777B]; --PC = 7777770B Terminate here at the end of the program }; END.