//D1Prin3v.bcpl More of procedure to prettyprint DMux
//DMux addresses ge 110B printed here.
//	Last edited: 2 June 1981

get "d1.d"
manifest [ get "d1pe.d" ]
manifest [ get "d1dmux.d" ]

external [
// MASM
	@WssCSS; PutsCSS; WssCS1; PutsCS1

// MCMD
	WnsCS1; WnsCS1D

// MPRINS
	PrinV0; NWss; PrinV1; NWss1

// MPATTERN
	@PATTERN

// D1GO
	PrintErrors

// D1PRIN2
	PrintWrdByt

// D1PRIN3W
	PrintDMXw

// Defined here
	PrintDMXv
]


let PrintDMXv(Addr) be
[	let T = nil
	switchon Addr into
	[
case dCLKRUN:
	T = PATTERN<<lh; WssCS1("ClkRate = "); WnsCS1(T)
	WssCS1(" (= "); T = 20000/T; WnsCS1D(T/10)
	PutsCS1($.); WnsCS1D(T rem 10); WssCS1(" ns)")
	NWss("ECLup ",#200)
	NWss("EnRefreshPeriod ")
	NWss("IOReset ")
	NWss("RunRefresh ")
	return
case dMEMRQ:
	PrinV0("PcF[8:15]",PATTERN<<lh)
	NWss(" NewF",#200)
	NWss(" KillResponse")
	NWss(" Pause")
	NWss(" RefOutstanding")
	NWss1("IncPcF ")
	NWss1("IncPcFG ")
	NWss1("WantIfuRef ")
	NWss1("ThreeOutOfFive "); return
case dLOADS:
	NWss("ValidRam ",#100000)
	NWss("J←OddF ")
	NWss("RealPcFG.15 ")
	NWss("FDv ")
	NWss("GDv ")
	NWss("HDv ")
	NWss("JDv ")
	NWss("MDv")
	NWss1("EnableFG ")
	NWss1("XLd ")
	NWss1("AlphaXLd ")
	NWss1("BrkLd ")
	NWss1("MLd ")
	NWss1("InstrAddrLd ")
	NWss1("JLda ")
	NWss1("GLd"); return
case dHJ:
	PrinV0("H",PATTERN<<lh)
	PrinV0(" J",PATTERN<<rh); return
case dMX:
	NWss("TwoAlphaX ",#100000)
	NWss("JFault ")
	NWss("HFault ")
	NWss("NM=17 ")
	NWss("TwoAlphaM ")
	NWss("TypeJumpM ")
	PrinV1("LengthM",(PATTERN rshift 8) & 3B)
	PrinV1(" DSel",(PATTERN rshift 6) & 3B)
	PrinV1(" LengthX",(PATTERN rshift 4) & 3B)
	PrinV1(" NX",PATTERN & 17B); return
case dJMPEXC:
	NWss("Exception ",#100000)
	NWss("SayNotReady ")
	NWss("WantResched ")
	NWss("SawRamParityErr ")
	NWss("SawFGParityErr ")
	NWss("ReschedPending ")
	NWss("KReady ")
	NWss1("ZapFGH ",#200)
	NWss1("ZapJ ")
	NWss1("NewJ ")
	NWss1("DoJump ")
	NWss1("TurnOffAlu ")
	NWss1("NewGo ")
	NWss1("BMuxEnable ")
	NWss1("FGFault "); return
case dPCJ:
	PrinV0("PcJ[8:15]",PATTERN<<lh)
	NWss(" MLdDly",#200)
	NWss(" BetaInM")
	NWss(" FGErrDly")
	NWss(" RAMErrDly")
	PrinV1("InstrSet[0:1]",(PATTERN rshift 2) & 3)
	NWss1(" OneByteJumpInJ",2)
	NWss1(" OneByteJumpInJd"); return
case dFFK:
	NWss("Test← ",#100000)
	NWss("GenOut← ")
	NWss("NewPC← ")
	NWss("IfuReset ")
	NWss("BrkIns← ")
	NWss("Testing ")
	NWss1("SignX ")
	NWss1("BrkPending ")
	NWss1("TypeJumpK ",#20)
	NWss1("TypePauseK ")
	PrinV1("LengthK",(PATTERN rshift 1) & 3B)
	NWss1(" SignK",#1); return
case dIDLY:
	NWss("GDvDly ",#100000)
	NWss("HDvDly ")
	NWss("FDvDly ")
	NWss("KReadyDly ")
	NWss("GLdDly ")
	NWss("IncPcFGDly ")
	NWss1("GFaultDly ")
	NWss1("ExceptionDly ")
	NWss1("TestMakeF←D ",#40)
	PrinV1("NK[0:3]",(PATTERN rshift 1) & #17)
	NWss1(" TwoAlphaK",#1); return

case dAPTRS:
	NWss("ACurrentWCBFlag ",#100000)
	PrinV0("AReaderPtr[1:7]",(PATTERN rshift 8) & 177B)
	NWss1("ANextWCBFlag ",#200)
	PrinV1("AWriterPtr[1:7]",PATTERN & 177B); return
case dBPTRS:
	NWss1("BCurrentWCBFlag ",#100000)
	PrinV1("BReaderPtr[1:7]",(PATTERN rshift 8) & 177B)
	NWss1(" BNextWCBFlag",#200)
	PrinV1(" BWriterPtr[1:7]",PATTERN & 177B); return
case dITEMS:
	PrinV0("AItem",PATTERN<<lh)
	PrinV1("BItem",PATTERN<<rh); return
case dSPSIZE:
	PrinV0("AServicePtr[1:4]",PATTERN<<nib0)
	PrinV1("BServicePtr[1:4]",PATTERN<<nib1)
	NWss(" AFifoFull",#200)
	NWss1(" BFifoFull")
	NWss(" ASize8")
	NWss(" ASize8-4")
	NWss(" ASize8-4-2")
	NWss1(" BSize8")
	NWss1(" BSize8-4")
	NWss1(" BSize8-4-2"); return
case dRESON:
	NWss("AOn ",#100000)
	NWss1("BOn ")
	PrinV0("ARes[0:1]",(PATTERN rshift 12) & 3)
	PrinV1("BRes[0:1]",(PATTERN rshift 10) & 3)
	NWss(" OISRcvdData",#400); return
case dTEMP:
	NWss(" CBTemp",#100000)
	NWss(" BaseBTemp")
	NWss(" ProcHTemp")
	NWss(" ProcLTemp")
	NWss(" IFUTemp"); return
case dAAD:
	PrinV0("Aad",PATTERN); return
case dMEMB:
	PrinV0("MemB[0:4]",PATTERN); return
case dBMUX:
	WssCSS("BMux = "); endcase
case dESTAT:
	if (PATTERN & (RAMPEena+MemoryPEena+MdPEena+IMrhPEena+IMlhPEena+
		IOBPEena+MIRDebugena)) ne 0 do
	[ WssCSS("Enabled: ")
	  NWss("RAMPE ",RAMPEena)
	  NWss("MemoryPE ",MemoryPEena)
	  NWss("MdPE ",MdPEena)
	  NWss("IMrh ")
	  NWss("IMlh ")
	  NWss("IOBPE ")
	  NWss("MIRDebug ")
	]
	T = PATTERN
	PrintErrors(PATTERN)	//Smashes PATTERN
	PATTERN = T
	test (PATTERN & (CIMlhPE+CIMrhPE)) eq CIMlhPE+CIMrhPE
	ifso WssCS1(", MIR-brkp")
	ifnot
	[ NWss1(", PE in MIR[0:20]",CIMlhPE)
	  NWss1(", PE in MIR[21:41]",CIMrhPE)
	]
	return
case dOLDCIA:
	PrintDMXw(Addr); return
default:
	endcase
	]
	PrintWrdByt(nil,lv PATTERN,nil,8)
	return
]