//D1Prin2.bcpl Procedures to prettyprint various registers and memories
// Last edited: 21 July 1980
get "d1.d"
manifest [ get "d1regmem.d" ]
structure IFU:
[ g0 bit 5
PA bit 1
IFaddrx bit 10
Sign bit 1
Par bit 3
Lengthx bit 2
RBaseBx bit 1
MemB bit 3
Typex bit 2
N bit 4
]
external [
// MASM
@WssCSS; PutsCSS; WssCS1; PutsCS1; GetField
// MRGN
CharInputRoutine
// MTXTBUF
ClearInText
// MSYM
SearchBlocks
// MIOC
DWns; Wns
// MCMD
WnsCSS; WnsCS1; WnsCS1D; CmdCommentStream; CmdCS1
// MPRINS
PrinV0; PrinV1; NWss; NWss1
// MPATTERN
@PATTERN
// D1ASM
stNotInVM
// D1VM
LookUpVA; LookUpAA; @VirtualP
// D1GO
PrCCV
// D1CONFIG
IMXmask
// D1PRIN4
PrinDMww
// Defined here
PrintWrdByt; PrintD1OUT; PrintShC; PrintSTKP; PrintPCX
PrintTLINK; PrintAATOVA; PrintIFUM; PrintMADDR; PrintBR
]
let PrintTLINK(X,DVec,AVec,Radix) be
[ let Val = DVec!0
let X = VirtualP ? IMx,IMXx
PrCCV(DVec-1,X)
if VirtualP & (Val ge 0) do
[ WssCSS(" = abs. "); WnsCSS(LookUpAA(Val))
]
//Put VA on input line for ease of examining that value
// for N = 4 to 13 by 3 do CharInputRoutine(GetField(N,3,lv Val)+60B)
// ClearInText()
]
and PrintAATOVA(X,DVec,AVec,Radix) be
[ test DVec!0 ge 0
ifso
[ let AVec1 = vec 1; AVec1!0 = 0; AVec1!1 = DVec!0 & IMXmask
SearchBlocks(CmdCommentStream,IMx,AVec1,-1,0)
WssCSS(" = abs. "); WnsCSS(LookUpAA(AVec1!1))
]
ifnot WssCSS(stNotInVM)
]
and PrintIFUM(X,DVec,AddrVec,Radix) be
[ let IFaddr = (DVec>>IFU.IFaddrx xor 1777B) lshift 2
let Sign = DVec>>IFU.Sign
let PA = DVec>>IFU.PA
let Par = DVec>>IFU.Par
let Length = (DVec>>IFU.Lengthx) xor 3
let RBaseB = (DVec>>IFU.RBaseBx) xor 1
let MemB = (DVec>>IFU.MemB)
let Type = DVec>>IFU.Typex xor 3
let N = DVec>>IFU.N
let AVec = vec 1; AVec!0 = 0
test Length eq 0
ifso WssCSS("?0?")
ifnot
[ test ((Type & 1) ne 0) & (Length eq 3)
ifso WssCSS("?3?")
ifnot WnsCSS(Length)
]
WssCSS("-byte ")
WssCSS(selecton Type into
[ case 0: "regular"
case 1: "jump"
case 2: "pause"
case 3: "?jump&pause?"
] )
WssCSS(" to ")
PrCCV((lv IFaddr)-1,IMXx)
// CharInputRoutine($I); CharInputRoutine($M)
// CharInputRoutine($X); CharInputRoutine($ )
// for I = 4 to 13 by 3 do
// [ CharInputRoutine(GetField(I,3,lv IFaddr)+60B)
// ]
// ClearInText()
test (Type & 1) ne 0 //Jump?
ifso
[ WssCS1("Displacement=")
test Length eq 1
ifso
[ let Disp = (PA lshift 4)+(Sign eq 0 ? N,N+177740B)
PutsCS1($.); DWns(CmdCS1,lv Disp,16,0,-8)
]
ifnot
[ if Sign ne 0 then WssCS1("Sign-ext ")
WssCS1("alpha")
]
]
ifnot
[ test N eq 17B
ifso WssCSS(", no N")
ifnot
[ WssCSS(", N="); WnsCSS(N)
]
WssCS1("PackedAlpha="); WnsCS1(PA)
WssCS1(", Sign="); WnsCS1(Sign)
]
WssCS1(", MemBase=")
test MemB ge 4
ifso //BR 34 to 37
[ AVec!1 = MemB+30B
SearchBlocks(CmdCS1,BRx,AVec,-1,0)
]
ifnot //BRX 0 to 3
[ AVec!1 = MemB
SearchBlocks(CmdCS1,BRXx,AVec,-1,0)
]
WssCS1(", RBaseB=")
WnsCS1(RBaseB)
test Par eq 0
ifso WssCS1(", Parity ok")
ifnot
[ if (Par & 4) ne 0 then WssCS1(", PE0 bad")
if (Par & 2) ne 0 then WssCS1(", PE1 bad")
if (Par & 1) ne 0 then WssCS1(", PE2 bad")
]
]
and PrintShC(X,DVec,AVec,Radix) be
[ PATTERN = DVec!0
WssCSS(((PATTERN & 20000B) ne 0 ? "T.","R."))
WssCSS(((PATTERN & 10000B) ne 0 ? "T","R"))
PrinV0(" Count",(PATTERN rshift 8) & 17B)
PrinV0(" RMask",(PATTERN rshift 4) & 17B)
PrinV0(" LMask",PATTERN & 17B)
WssCSS(" = "); PrintWrdByt(X,DVec,AVec,Radix)
]
and PrintSTKP(X,DVec,AVec,Radix) be
[ PATTERN = DVec!0
NWss("Stack ovf ",#200)
NWss("Stack und ")
PrinV0("StkP",DVec>>lh)
]
and PrintD1OUT(X,DVec,AVec,Radix) be
[ PATTERN = DVec!0
let data = PATTERN rshift 7
let datar1 = data rshift 1
switchon (PATTERN rshift 3) & 7B into
[
case 0: WssCSS("Control[")
NWss("ClrStop",ClrStop)
NWss(" StopAtt1")
NWss(" Jam")
NWss(" Freeze")
NWss(" ClrMIR")
NWss(" ClrCT")
NWss(" SetRun")
NWss(" SetSS"); endcase
case 1: WssCSS("Clock[")
NWss(" DAddrBit",DAddrBit)
NWss(" ShiftDMux")
NWss(" GetTLINK",GetTLINK)
NWss(" UseCPReg")
NWss(" UseDMD")
NWss(" BaseBAtten"); endcase
case 2: WssCSS("CPReg0["); WnsCSS(datar1); endcase
case 3: WssCSS("CPReg1["); WnsCSS(datar1); endcase
case 4: WssCSS("Mir0["); WnsCSS(data); endcase
case 5: WssCSS("Mir1["); WnsCSS(data); endcase
case 6: WssCSS("Mir2["); WnsCSS(data); endcase
case 7: WssCSS("Mir3["); WnsCSS(data); endcase
]
PutsCSS($])
NWss(100B," Strobe")
]
and PrintWrdByt(X,DVec,AVec,Radix) be
[ Wns(CmdCommentStream,DVec!0,0,Radix); WssCSS(" = ")
Wns(CmdCommentStream,DVec>>lh,0,Radix); WssCSS(",,")
Wns(CmdCommentStream,DVec>>rh,0,Radix)
]
and PrintPCX(X,DVec,AVec,Radix) be
[ PrinV0("Word",DVec!0 rshift 1); PrinV0(" byte",DVec!0 & 1)
]
and PrintMADDR(X,DVec,AVec,Radix) be
[ switchon AVec!1 into
[
case 2B: WssCSS("No. test iterations="); endcase
//**Microcomputer smashes this; should pretty-print signal name
case 3B: [ PrinV0("DMux signal addressed when running",DVec!1)
WssCSS(" =")
let Addr = (DVec!1 rshift 4) & 377B
let Mask = 100000B rshift ((DVec+1)>>nib3)
let ECSS,ECS1 = 0,0
PrinDMww(Addr,Mask,lv ECSS,lv ECS1,true)
return
]
case 6B: WssCSS("Address bits always 1 on failures="); endcase
case 7B: WssCSS("Union of address bits that were 1 on failures="); endcase
case 11B: PrinV0("No. false halts detected by CheckStopped",DVec!0)
PrinV1("No. microcomputer timeouts",DVec!1); return
case 12B: PrinV0("Count of PE's in MIR[21:41]",DVec!1)
PrinV1("Count of PE's in MIR[0:20]",DVec!0); return
default: endcase
]
DWns(CmdCommentStream,DVec,32,0,Radix)
]
//Used for both BR and BRX
and PrintBR(X,DVec,AVec,Radix) be
[ DWns(CmdCommentStream,DVec)
]