DIRECTORY Basics USING [SwapHalves], Buttons USING [Create], Containers USING [ChildXBound], IO, Labels USING [Create], PopUpSelection USING [Request], ViewerTools USING [MakeNewTextViewer, SetContents, SetSelection], SoftcardOps, SoftcardToolPrivate; SoftcardToolRegistersImpl: CEDAR PROGRAM IMPORTS Basics, Buttons, Containers, IO, Labels, PopUpSelection, ViewerTools, SoftcardOps, SoftcardToolPrivate EXPORTS SoftcardToolPrivate = BEGIN OPEN IO, SoftcardToolPrivate; euRegValText: Viewer; euSelectChoice: INT _ -1; euSelectArray: PUBLIC ARRAY [0..8] OF ROPE; aAddrText, bAddrText, cAddrText: Viewer; leftSrcText, rightSrcText: Viewer; st2ASrcText, st3ASrcText: Viewer; euFieldInsertText, euFieldMaskText, euFieldShiftText: Viewer; BuildRegisterButtons: PUBLIC PROC[topViewer, sibx: Viewer] RETURNS[sib: Viewer] = { sib _ sibx; sib _ Labels.Create[ info: [ name: " Regular EU Registers ", parent: topViewer, wx: leftEdge, wy: sib.wy+sib.wh+betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE], font: labelFont ]; sib _ Buttons.Create[ info: [name: " Read ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: ReadEUReg ]; sib _ Buttons.Create[ info: [name: " Write ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: WriteEUReg ]; sib _ Buttons.Create[ info: [name: "Val: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: selectFont, proc: EUValProc ]; sib _ euRegValText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 600, wh: entryHeight, border: FALSE, scrollable: FALSE]]; Containers.ChildXBound[topViewer, sib]; sib _ Labels.Create[ info: [ name: " EU Field Register ", parent: topViewer, wx: leftEdge, wy: sib.wy+sib.wh+betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE], font: labelFont ]; sib _ Buttons.Create[ info: [name: " Read ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: ReadEUFieldReg ]; sib _ Buttons.Create[ info: [name: " Write ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: WriteEUFieldReg ]; sib _ Buttons.Create[ info: [name: "Insert [0..1] ", parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: EUFieldInsertProc ]; sib _ euFieldInsertText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 20, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: "Mask [0..1fH] ", parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: EUFieldMaskProc ]; sib _ euFieldMaskText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 60, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: "Shift [0..3fH] ", parent: topViewer, wx: sib.wx+sib.ww+xFudge+6, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: EUFieldShiftProc ]; sib _ euFieldShiftText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 60, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Labels.Create[ info: [ name: " EU KReg ", parent: topViewer, wx: leftEdge, wy: sib.wy+sib.wh+betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE], font: labelFont ]; sib _ Buttons.Create[ info: [name: " Read ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: ReadKReg ]; sib _ Buttons.Create[ info: [name: " Write ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, scrollable: FALSE ], font: activeFont, proc: WriteKReg ]; sib _ Buttons.Create[ info: [name: " aAddr [0..ffH]: ", parent: topViewer, wx: leftEdge+40, wy: sib.wy+sib.wh+betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: AAddrProc ]; sib _ aAddrText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+8, wy: sib.wy, ww: 70, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " bAddr [0..ffH]: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: BAddrProc ]; sib _ bAddrText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 70, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " cAddr [0..ffH]: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: CAddrProc ]; sib _ cAddrText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+8, wy: sib.wy, ww: 70, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " leftSrc [0..3]: ", parent: topViewer, wx: leftEdge+40, wy: sib.wy+sib.wh+betweenHeight, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: LeftSrcProc ]; sib _ leftSrcText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+2, wy: sib.wy, ww: 40, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " rightSrc [0..7]: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: RightSrcProc ]; sib _ rightSrcText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+8, wy: sib.wy, ww: 40, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " st2ASrc [0..3]: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: St2ASrcProc ]; sib _ st2ASrcText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+8, wy: sib.wy, ww: 40, wh: entryHeight, border: FALSE, scrollable: FALSE]]; sib _ Buttons.Create[ info: [name: " st3ASrc [0..1]: ", parent: topViewer, wx: sib.wx+sib.ww+xFudge, wy: sib.wy, wh: entryHeight, border: FALSE, scrollable: FALSE ], font: tinySelectFont, proc: St3ASrcProc ]; sib _ st3ASrcText _ ViewerTools.MakeNewTextViewer[ info: [parent: topViewer, wx: sib.wx+sib.ww+xFudge+8, wy: sib.wy, ww: 40, wh: entryHeight, border: FALSE, scrollable: FALSE]]; }; ReadEUReg: ClickProc = { which: SoftcardOps.EUInternal; name: ROPE; val: CARD; [which, name] _ SelectEURegister[]; IF name = NIL THEN RETURN; val _ SoftcardOps.ReadEURegister[which]; tsOut.PutF[" The value of EUReg %g is: %xH\n", [rope[name]], [integer[val]] ]; ViewerTools.SetContents[euRegValText, IO.PutFR["%xH", [integer[val]]] ]; SetDragonStateLabelButton[stopped]; }; WriteEUReg: ClickProc = { which: SoftcardOps.EUInternal; name: ROPE; val: CARD; [which, name] _ SelectEURegister[]; IF name = NIL THEN RETURN; val _ GetAsCard[euRegValText]; SoftcardOps.WriteEURegister[which, val]; tsOut.PutF["EUReg %g has been set: %xH\n", [rope[name]], [integer[val]] ]; SetDragonStateLabelButton[stopped]; }; EUValProc: ClickProc = { ViewerTools.SetSelection[euRegValText, NIL] }; SelectEURegister: PROC RETURNS[reg: SoftcardOps.EUInternal, name: ROPE] = { which: INT = PopUpSelection.Request[ header: "Regular EU Register", choice: LIST[euSelectArray[0], euSelectArray[1], euSelectArray[2], euSelectArray[3], euSelectArray[4], euSelectArray[5], euSelectArray[6], euSelectArray[7], euSelectArray[8]] ]; SELECT which FROM 1 => RETURN[left, euSelectArray[0]]; 2 => RETURN[right, euSelectArray[1]]; 3 => RETURN[st2A, euSelectArray[2]]; 4 => RETURN[st2B, euSelectArray[3]]; 5 => RETURN[st3A, euSelectArray[4]]; 6 => RETURN[r2B, euSelectArray[5]]; 7 => RETURN[r3A, euSelectArray[6]]; 8 => RETURN[r3B, euSelectArray[7]]; 9 => RETURN[dataIn, euSelectArray[8]]; ENDCASE => RETURN[left, NIL]; }; ReadEUFieldReg: ClickProc = { val: CARD32 = SoftcardOps.ReadEURegister[field]; field: SoftcardOps.FieldDesc = LOOPHOLE[Basics.SwapHalves[LOOPHOLE[val]] ]; ViewerTools.SetContents[euFieldInsertText, IO.PutFR["%g", [integer[field.insert]]] ]; ViewerTools.SetContents[euFieldMaskText, IO.PutFR["%xH", [integer[field.mask]]] ]; ViewerTools.SetContents[euFieldShiftText, IO.PutFR["%xH", [integer[field.shift]]] ]; SetDragonStateLabelButton[stopped]; tsOut.PutF[ "\tThe value of EU Field Register is:\n[insert: %xH, mask: %xH, shift: %xH]\n", [integer[field.insert]], [integer[field.mask]], [integer[field.shift]] ]; }; WriteEUFieldReg: ClickProc = { format: ROPE = "\n**** Please fill in the %g field\n"; field: SoftcardOps.FieldDesc; typeIn: CARD32; ok: BOOL; [ok, typeIn] _ CheckedGetAsCard[euFieldInsertText]; IF ~ok THEN { tsOut.PutF[format, [rope["Insert"]] ]; RETURN; }; IF typeIn > 1 THEN { tsOut.PutF["\n*** Insert field is restricted to [0..1], %g is invalid\n", [cardinal[typeIn]] ]; RETURN; }; field.insert _ typeIn; [ok, typeIn] _ CheckedGetAsCard[euFieldMaskText]; IF ~ok THEN { tsOut.PutF[format, [rope["Mask"]] ]; RETURN; }; IF typeIn > 1fH THEN { tsOut.PutF["\n*** Mask field is restricted to [1..1fH], %g is invalid\n", [cardinal[typeIn]] ]; RETURN; }; field.mask _ typeIn; [ok, typeIn] _ CheckedGetAsCard[euFieldShiftText]; IF ~ok THEN { tsOut.PutF[format, [rope["Shift"]] ]; RETURN; }; IF typeIn > 3fH THEN { tsOut.PutF["\n*** Mask field is restricted to [1..3fH], %g is invalid\n", [cardinal[typeIn]] ]; RETURN; }; field.mask _ typeIn; }; EUFieldInsertProc: ClickProc = { ViewerTools.SetSelection[euFieldInsertText, NIL ] }; EUFieldMaskProc: ClickProc = { ViewerTools.SetSelection[euFieldMaskText, NIL ] }; EUFieldShiftProc: ClickProc = { ViewerTools.SetSelection[euFieldShiftText, NIL ] }; ReadKReg: ClickProc = { val: CARD32 = SoftcardOps.ReadEURegister[kReg]; kReg: SoftcardOps.KReg = LOOPHOLE[Basics.SwapHalves[LOOPHOLE[val]] ]; ViewerTools.SetContents[aAddrText, IO.PutFR["%xH", [integer[kReg.aAddr]]] ]; ViewerTools.SetContents[bAddrText, IO.PutFR["%xH", [integer[kReg.bAddr]]] ]; ViewerTools.SetContents[cAddrText, IO.PutFR["%xH", [integer[kReg.cAddr]]] ]; ViewerTools.SetContents[leftSrcText, IO.PutFR["%g", [integer[kReg.leftSrc]]] ]; ViewerTools.SetContents[rightSrcText, IO.PutFR["%g", [integer[kReg.rightSrc]]] ]; ViewerTools.SetContents[st2ASrcText, IO.PutFR["%g", [integer[kReg.st2ASrc]]] ]; ViewerTools.SetContents[st3ASrcText, IO.PutFR["%g", [integer[kReg.st3ASrc]]] ]; SetDragonStateLabelButton[stopped]; tsOut.PutF["\tThe value of EU KReg is:\n[aAddr: %xH, bAddr: %xH, cAddr: %xH, ", [integer[kReg.aAddr]], [integer[kReg.bAddr]], [integer[kReg.cAddr]] ]; tsOut.PutF["leftSrc: %g, rightSrc: %g, st2ASrc: %g, st3ASrc: %g\n", [integer[kReg.leftSrc]], [integer[kReg.rightSrc]], [integer[kReg.st2ASrc]], [integer[kReg.st3ASrc]] ]; }; WriteKReg: ClickProc = { kReg: SoftcardOps.KReg; val: CARD32; kReg.aAddr _ GetAsCard[aAddrText]; kReg.bAddr _ GetAsCard[bAddrText]; kReg.cAddr _ GetAsCard[cAddrText]; kReg.leftSrc _ GetAsCard[leftSrcText]; kReg.rightSrc _ GetAsCard[rightSrcText]; kReg.st2ASrc _ GetAsCard[st2ASrcText]; kReg.st3ASrc _ GetAsCard[st3ASrcText]; val _ LOOPHOLE[Basics.SwapHalves[LOOPHOLE[kReg]] ]; SoftcardOps.WriteEURegister[kReg, val]; SetDragonStateLabelButton[stopped]; tsOut.PutRope[" The EU KReg has been written\n"]; }; AAddrProc: ClickProc = { ViewerTools.SetSelection[aAddrText, NIL] }; BAddrProc: ClickProc = { ViewerTools.SetSelection[bAddrText, NIL] }; CAddrProc: ClickProc = { ViewerTools.SetSelection[cAddrText, NIL] }; LeftSrcProc: ClickProc = { ViewerTools.SetSelection[leftSrcText, NIL] }; RightSrcProc: ClickProc = { ViewerTools.SetSelection[rightSrcText, NIL] }; St2ASrcProc: ClickProc = { ViewerTools.SetSelection[st2ASrcText, NIL] }; St3ASrcProc: ClickProc = { ViewerTools.SetSelection[st3ASrcText, NIL] }; Init: PROC = { euSelectArray[0] _ "left"; euSelectArray[1] _ "right"; euSelectArray[2] _ "st2A"; euSelectArray[3] _ "st2B"; euSelectArray[4] _ "st3A"; euSelectArray[5] _ "r2B"; euSelectArray[6] _ "r3A"; euSelectArray[7] _ "r3B"; euSelectArray[8] _ "dataIn"; }; Init[]; END. SoftcardToolRegistersImpl.mesa Copyright Σ 1987 by Xerox Corporation. All rights reserved. Willie-Sue, March 4, 1987 4:00:38 pm PST * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Regular EU registers EU field register EU KReg * * * * * start code Κ ˜codešœ™Kšœ<™J˜Jšœ'˜'J˜——™šœ˜šœ7˜7Jšœ@˜@Jšœ œœ˜#—J˜—J˜šœ˜šœ)˜)JšœCœ˜K—Jšœ)˜)—J˜šœ˜šœ*˜*JšœCœ˜K—Jšœ*˜*J˜—šœ˜šœ1˜1Jšœ8˜8Jšœœœ˜#—Jšœ0˜0J˜—šœ8˜8JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ1˜1Jšœ8˜8Jšœœœ˜#—Jšœ.˜.J˜—šœ6˜6JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ2˜2Jšœ8˜8Jšœœœ˜#—Jšœ/˜/J˜—šœ7˜7JšœA˜AJšœ"œœ˜=J˜——™šœ˜šœ.˜.Jšœ@˜@Jšœ œœ˜#—J˜—J˜šœ˜šœ)˜)JšœCœ˜K—Jšœ#˜#—J˜šœ˜šœ*˜*JšœCœ˜K—Jšœ$˜$J˜—šœ˜šœ4˜4JšœB˜BJšœœœ˜#—Jšœ(˜(J˜—šœ0˜0JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ4˜4Jšœ6˜6Jšœœœ˜#—Jšœ(˜(J˜—šœ0˜0JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ4˜4Jšœ6˜6Jšœœœ˜#—Jšœ(˜(J˜—šœ0˜0JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ4˜4JšœB˜BJšœœœ˜#—Jšœ*˜*J˜—šœ2˜2JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ5˜5Jšœ6˜6Jšœœœ˜#—Jšœ+˜+J˜—šœ3˜3JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ4˜4Jšœ6˜6Jšœœœ˜#—Jšœ*˜*J˜—šœ2˜2JšœA˜AJšœ"œœ˜=J˜—šœ˜šœ4˜4Jšœ6˜6Jšœœœ˜#—Jšœ*˜*J˜—šœ2˜2JšœA˜AJšœ"œœ˜=——J˜J˜J˜—šž œ˜Jšœ˜Jšœœ˜ Jšœœ˜ Jšœ#˜#Jšœœœœ˜Jšœ(˜(JšœN˜NJšœ&œ ˜HJšœ#˜#J˜J˜—šž œ˜Jšœ˜Jšœœ˜ Jšœœ˜ Jšœ#˜#Jšœœœœ˜Jšœ˜Jšœ(˜(JšœJ˜JJšœ#˜#Jšœ˜J˜—šž œ ˜Jšœ)œ˜0J˜—šžœœœ$œ˜Kšœœ˜$Jšœ˜Jšœœ₯˜±—šœ˜Jšœœ˜%Jšœœ˜&Jšœœ˜%Jšœœ˜%Jšœœ˜%Jšœœ˜$Jšœœ˜$Jšœœ˜$Jšœœ˜'Jšœœœ˜—J˜J˜—šžœ˜Jšœœ%˜0Jšœœœ ˜KJšœ+œ(˜UJšœ)œ'˜RJšœ*œ(˜TJšœ#˜#šœ ˜ šœO˜OJšœI˜I——J˜J˜—šžœ˜Jšœœ*˜6Jšœ˜Jšœœ˜Jšœœ˜ Jšœ3˜3šœœ˜ Jšœœ˜&Jš˜J˜—šœ œ˜Jšœ_˜_Jšœ˜J˜—J˜Jšœ1˜1šœœ˜ Jšœ$˜$Jš˜J˜—šœœ˜šœI˜IJšœ˜—Jšœ˜J˜—Jšœ˜Jšœ2˜2šœœ˜ Jšœ%˜%Jš˜J˜—šœœ˜Jšœ_˜_Jšœ˜J˜—Jšœ˜J˜J˜—šžœ ˜Jšœ.œ˜6J˜—šžœ ˜Jšœ,œ˜4J˜—šžœ ˜Jšœ-œ˜5J˜—šžœ˜Jšœœ$˜/Jšœœœ ˜EJšœ#œ'˜LJšœ#œ'˜LJšœ#œ'˜LJšœ%œ(˜OJšœ&œ)˜QJšœ%œ(˜OJšœ%œ(˜OJšœ#˜#J˜šœO˜OJšœF˜F—šœC˜CJšœK˜KJšœ˜—J˜J˜—šž œ˜Jšœ˜Jšœœ˜ Jšœ"˜"Jšœ"˜"Jšœ"˜"Jšœ&˜&Jšœ(˜(Jšœ&˜&Jšœ&˜&Jšœœœ ˜3Jšœ'˜'Jšœ#˜#J˜1J˜J˜—šž œ4œ˜DJ˜—šž œ4œ˜DJ˜—šž œ4œ˜DJ˜—šž œ6œ˜HJ˜—šž œ7œ˜JJ˜—šž œ6œ˜HJ˜—šž œ6œ˜HJ˜—šžœœ˜KšœΟtœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜KšœŸœŸ˜K˜K˜——™K˜šœ˜J˜——Kšœ˜—…—0φ>