// DoradoProms.bcpllast updated June 9, 1983 6:19 PM by Taft
// by Gene. Change command file format to accommodate PROLOGUE prom blower
// by invoking PNEW with a different set of switches.
// by PIER. Removed Control Proms (model 0 version)
// removed IDIS proms.
get "Streams.d"
get "DoradoProms.defs"
external //system proceedures used in this file only
[
//ContProms; ProcProms; MemProms; JunkIOProms; DispProms; DiskProms
OpenFile; Closes; Ws; Wss; Wns; Puts; Wo; dsp; CallSwat
SetupReadParam; ReadParam; ReadParamStream
]
static
[
stream; CmStream; BinListStream=0
MemoryNumber = 0; PromNumber = 0; MemWidth; MemName
ICtype; NewType
]
let D1proms() be
[
let version = "*nDoradoProms of June 9, 1983"
let DoAll = false
let switchVec = vec 10
let NameVec = vec 40
let MemVec = vec 100
let BoardVec = vec 100
stream = OpenFile("DoradoProms.mb",ksTypeWriteOnly,wordItem)
Ws("Creating file ’DoradoProms.mb’.")
for I = 1 to LastType do
[
ICtype = I
NewType = true
OpenCmFile()
SetupReadParam(NameVec, switchVec,0,switchVec)
if switchVec!0 & not BinListStream then
BinListStream = OpenFile("Rem.cm",ksTypeWriteOnly,charItem)
NameVec!0 = 0
ReadParam($P,0,0,0,true)
[ let SavedStr = NameVec!0
external ProcProms; ProcProms(NameVec); NameVec!0 = SavedStr
external MemProms; MemProms(NameVec); NameVec!0 = SavedStr
external DisplayProms; DisplayProms(NameVec); NameVec!0 = SavedStr
external DiskProms; DiskProms(NameVec); NameVec!0 = SavedStr
external EtherProms; EtherProms(NameVec); NameVec!0 = SavedStr
external IFUProms; IFUProms(NameVec); NameVec!0 = SavedStr
external JunkIOProms; JunkIOProms(NameVec); NameVec!0 = SavedStr
//IFUProms(); NameVec!0 = SavedStr
NameVec!0 = 0
ReadParam($P,0,0,0,true)
if NameVec!0 eq 0 then break
] repeat
Wss(CmStream,"*n//*n//*n//Done")
Closes(CmStream)
Closes(ReadParamStream)
]
Puts(stream,0) //send a zero to indicate end of file
Puts(stream,0) //send a zero to indicate end of file
Closes(stream)
if BinListStream then [ Puts(BinListStream,$*n); Closes(BinListStream) ]
Ws(version)
Ws(" -- Total: Memories=")
Wns(dsp,MemoryNumber,2)
Ws(" Proms=")
Wns(dsp,PromNumber,2)
Ws(".")
]
and Header(name,width,Buff,Count,adjust) be
[ MemoryNumber = MemoryNumber + 1
MemWidth = width
MemName = name
test NewType
ifso [ Ws("*n"); Ws(ICtypeString(ICtype)); Ws(" Proms: "); NewType = 0 ]
ifnot Ws(", ")
Ws(MemName)
Puts(stream,4) //specify memory number and width
Puts(stream,MemoryNumber) // memory number
Puts(stream,width) // width
let length = MemName>>str.length
let ptr = 1
[ let wrd = 0
if ptr le length then wrd = (MemName>>str.char↑ptr) lshift 8
if ptr ls length then wrd = wrd + MemName>>str.char↑(ptr+1)
Puts(stream,wrd) //2 characters of memory name
if ptr ge length then break
ptr = ptr + 2
] repeat
Puts(stream,2) //set memory number and starting address
Puts(stream,MemoryNumber) //memory number
Puts(stream,0) //starting address = 0
if BinListStream then
[
Wss(BinListStream,"*nBinList DoradoProms.mb/f ")
Wss(BinListStream,name); Wss(BinListStream,"/M ")
Wss(BinListStream,name); Wss(BinListStream,".ls/L Prom:-*"")
Wss(BinListStream,name); Wss(BinListStream,"*"-Labeled:-*"")
]
Body(Buff,Count,adjust)
]
and Body(Buff,Count,adjust) be
[ let mask = 0
for i = 1 to MemWidth do mask = (mask rshift 1) % #100000
for address = 0 to Count-1 do
[
let data = Buff!address//get the next word
data = data lshift adjust//left justify it
data = data & mask//now mask off the unused bits
Puts(stream,1) //send data for memory
Puts(stream,0) // source line, don’t care
Puts(stream,data )
]
]
and PromCommand(Label,Lbit,Faddr; numargs nargs) be
[ PromNumber = PromNumber + 1
if nargs ls 2 then Lbit = "0"
if nargs ls 3 then Faddr = "0"
Wss(CmStream,"*n//*n//")
Wss(CmStream,"*n// About to define ’")
Wss(CmStream,MemName)
Wss(CmStream,"’. Label ’")
Wss(CmStream,Label)
Wss(CmStream,"’ when done.*n@doit@")
if ICtype eq N74288
then Wss(CmStream,"PNew 2/T D/R DoradoProms.mb/F ")
if (ICtype eq MC10149) % (ICtype eq I3601)
then Wss(CmStream, "PNew DoradoProms.mb/F 0,1,2,3,4,5,6,7/P D/R ")
if (ICtype eq MC10139) % (ICtype eq N74288)
then Wss(CmStream,"PNew DoradoProms.mb/F ")
Wss(CmStream,MemName)
Wss(CmStream,"/M 0/C 0/B ")
Wss(CmStream,Faddr)
Wss(CmStream,"/A ")
Wss(CmStream,Lbit)
Wss(CmStream,"/S*n")
Wss(CmStream,"*n// The last Prom should be labeled ’")
Wss(CmStream,Label)
Wss(CmStream,"’.")
if BinListStream then
[
Wss(BinListStream,"̌-*"")
Wss(BinListStream,Label); Wss(BinListStream,"*"/I")
]
]
and OpenCmFile() be
[
let str = vec 100
str>>str.length = 0
AppendS(ICtypeString(ICtype),str)
AppendS(".cm",str)
CmStream = OpenFile(str,ksTypeWriteOnly,charItem)
Wss(CmStream,"//Dummy first line")
Wss(CmStream,"*n//Use personality card for ")
Wss(CmStream,ICtypeString(ICtype))
Wss(CmStream,"s.")
]
and ICtypeString(Type) =valof
[
switchon Type into
[
case MC10139:resultis "MC10139"
case MC10149:resultis "MC10149"
case N74288:resultis "N74288"
case I3601:resultis "I3601"
default: CallSwat("Prom Type not defined in ICtypeString")
]
]
//checks all characters of the shorter string eq the start of the second string
//ignores the difference between upper and lower case characters
and StEq(S1,S2) =valof
[
if (not S1!0) % (not S2!0) then resultis true //null string means "don’t care" so do it
let Length = S1>>str.length ls S2>>str.length? S1>>str.length,S2>>str.length
for i = 1 to Length do
if ((S1>>str.char↑i xor S2>>str.char↑i) & #137) ne 0 then resultis false
resultis true
]
and AppendC(char,string) be
[
let st = string>>str.length +1
string>>str.char↑st = char
string>>str.length = st
]
and AppendS(sts,std) be //copy from source to destination
[
for i = 1 to sts>>str.length do AppendC(sts>>str.char↑i,std)
]