*---------------------------------------------------------------------------- Title[AltoEtherEmu.Mc...January 9, 1981 11:38 AM...Taft]; * Emulator-level microcode for operating Dorado Ethernet *---------------------------------------------------------------------------- *---------------------------------------------------------------------------- * Emulator Task -- SIO instruction *---------------------------------------------------------------------------- Set[XTask, IP[EMU]]; * Emulator mode TopLevel; DontKnowRBase; * Get here with the SIO control bits in Stack. * Alto and Mesa emulators here at the end of SIO emulation after * first processing control bits for any other devices (e.g., Trident). ESIO: T_ EControl; Stack_ (Stack) AND (3C); * Mask Ethernet control bits T_ A0, TIOA_ T, Branch[SIONop, ALU=0]; * Select control register * Control bits nonzero. Must first reset the hardware and tasks. * Addressing constraints require one instruction between the conditional * Branch (above) and the CALL, and the CALLs must leave FF free. TaskingOff; Call[EResI]; * Reset input Call[EResO]; * Reset output T_ A0, BDispatch_ Stack; * Dispatch on function bits SIO0: TaskingOn, Branch[SIO0], DispTable[4, 7, 4]; * Dispatch 0 can't happen * 01 -- Start transmitter T_ TurnOnTx, Branch[SIOStart]; * Enable output wakeups * 10 -- Start receiver T_ TurnOnRx, Branch[SIOStart]; * Enable input wakeups * 11 -- Reset interface T_ ECmdBits, Branch[SIOReset]; * Manufacture "abort" status SIOStart: T_ A0, Output_ T, Branch[SIONop]; SIOReset: T_ T XOR (CmdAbort); Call[EPost]; * Post it (must leave FF free) T_ A0; * 00 -- Noop, just return Ethernet address. * Note that this is the tail of the other 3 cases. T=0 here SIONop: Stack_ InputNoPE; * Read status PD_ Stack, TIOA_ T; * TIOA_ 0 Stack_ RSH[Stack, 10], * Right-justify Ethernet address Branch[.+2, ALU=0]; * Branch if status word entirely zero Stack&-1_ (Stack&-1) OR (77400C), IFUJump[0]; * 177 .. Ethernet addr * Apparently no Ethernet interface installed. * Alto software expects to see 77777 in this case. Stack&-1_ 77777C, IFUJump[0]; *---------------------------------------------------------------------------- * Ethernet Boot *---------------------------------------------------------------------------- * The emulator branches here after doing all other initialization. * When the Breath of Life packet has been received, we branch to * the emulator main loop. KnowRBase[AEmRegs]; EBoot: T_ A0, MemBase_ ECBR; * Address page 1 Store_ EBLoc, DBuf_ T; * EBLoc_ 0 (interrupt bit mask) ETemp_ (Store_ EOCLoc)-1, DBuf_ T; * EOCLoc_ 0 (output count) ETemp_ (Store_ ETemp)-1, DBuf_ 1C; * EIPLoc_ 1 (input pointer) Store_ ETemp, DBuf_ 400C; * EICLoc_ 400 (input count) ETemp_ EHLoc; Store_ ETemp, DBuf_ 377C; * EHLoc_ 377 (host address) T_ EControl; TIOA_ T; TaskingOff; * Reset input hardware and microcode Call[EResI]; TaskingOn; * Loop to await Breath of Life packet. * Turn on receiver, wait for a packet to arrive. If an OK receiver status * is posted and the packet type is Breath of Life, set the PC to 3 and * start the emulator. EBLoop: ETemp_ A0, MemBase_ ECBR; * Address page 1 EBLoo1: T_ (Store_ EPLoc), DBuf_ ETemp; * EPLoc_ 0 (post location) Fetch_ T, T_ TurnOnRx; * Fetch to prime MD for wait loop Output_ T; * Turn on receiver Fetch_ EPLoc, T_ (PD_ MD); * Wait for EPLoc to go nonzero T_ T-(377C), Branch[.-1, ALU=0]; * Test for OK receiver status T_ 202C, Branch[EBLoo1, ALU#0]; MemBase_ MDS; * Address page 0 Fetch_ 2S; * Fetch word 2 (packet type) T_ T+(400C); * T_ 602 = typeBreathOfLife PD_ T-MD; Branch[EBLoop, ALU#0]; * Loop if type is wrong T_ 3C, Branch[Start]; * Start emulator at location 3 (1552)