Page Numbers: Yes X: 530 Y: 10.5" First Page: 37
Margins: Top: 1.3" Bottom: 1"
Heading:
Internal Description of MidasEdward R. Fiala26 November 1979
MRGN.BCPL (resident display region code and main control program)
DriverLoop()
This is the main loop of Midas also called by StartCmdOverlay. The top level returns only for exit from midas. QuitCmdOverlay is used to exit from actions running under StartCmdOverlay. DriverLoop calls UpdateDisplay when screen lines are dirty, CharInputRoutine(Gets(keys)) for keyboard input, tracks mouse movement, and for executing various routines when the mouse moves to different display regions or has its buttons clicked.
PaintSetup(Rgn,rlx)
Sets up the DisplayMaxrcx, Displayalx, and Displayacx statics to delimit the display area covered by the line rlx in the region Rgn and marks the screen line dirty; returns the screen line as its value.
PaintMark(R,rlx,firstC,lastC,Flag)
clears or sets the black-for-white invert flag in the characters for a particular menu item. R is the display region, rlx the relative line number, firstC and lastC the relative character positions in the line, and Flag is 200B for invert, or 0 for non-invert.
PaintRgnLine(R,rlx,TV)
moves text from TV into ScreenTV for region R (called by PaintDirtyRegions and by FormCmdmenuText).
PaintDirtyRegions()
Moves text from TextVec’s to ScreenTV for all regions which are not menu regions (Menu regions paint directly into ScreenTV.)
UpdateEveryTime()
calls the procedures on the EveryTimeList.
* AddToEveryTimeList(Proc,Arg)
assures that a call will be made to "Proc(Arg)" once every time around the main driver loop. AddTo... returns as result a pointer which can be used as an argument to RemoveFromEveryTimeList.
* RemoveFromEveryTimeList(Entry)
will stop the calls resulting from an earlier call on AddToEveryTimeList, where that earlier call returned Entry.
@NewLx Cursor line index
@NewCx Cursor character index
Displayalx, Displayacx, DisplayMaxrcx, CharInputRoutine
ErrorFlag
A predicate set true while DisplayError is in progress. When true, it prevents calls to EveryTimeList procedures and to Action procedures outside the command menu region (which is showing the error menu).
AllowedRgn
The allowed region (command menu region) during an error.
ScreenLinesDirty
Set true when UpdateDisplay should be called.
ScreenTV
A vector of length ScreenHeight+1 in which ScreenTV!0 contains ScreenHeight and the other entries point at strings of length ScreenWidth. The bit buffers are built from these strings.
SelectedRegion
The currently selected display region.
RegionTable
Table of pointers to the Rgn structures for each region. The first entry is NopRgn (the entire active display area). Then come the name-value menu regions, which must be contiguous pointers in the table. The other regions come after this.
MMENU.BCPL (resident menu management)
* CreateAction(Name,lv Proc,Arg,lv MProc,Char)
creates an action for use in a menu. Name is a text name for the action. Proc is a procedure. (lv is used so if the contents of the static changes, e.g. during swapout, the action will use the changed value of the static.) Arg is supplied as Arg1 in the call to Proc. The five-word Action structure is appended to ActionBlock and the name string is not copied, so it must be resident during the lifetime of the action. If lv MProc is given and non-zero, MProc will be called each time mouse buttons or position change and this action is the selected menu item. Char is a character which invokes the action from the keyboard when ";" precedes it (and "=" and ":" not preceded by ";")
ForgetTemporaryActions()
Deletes actions created during command overlay (normally called from QuitCmdOverlay() in MCmd.Bcpl).
DoAction(Action,MBunion,MDFS)
Executes Action. Action points at a 5-word ActionBlock entry which contains the procedure called (Action.lvProc) and some flags that control whether or not the command comment lines are reset and the handling of a subsequent <esc>. MBunion is the union of all buttons down since last up; MDFS is the menu in which the action is executed.
DoTextAction(Char)
exectutes the action whose command character is Char in the command menu.
ExecuteTextCmdStream(Stream)
is used to read commands from a text stream, of the form created by the WrtCmds.
LookUpMenu(Letter,LineN)
Letter is the menu letter ($A to $Z) and LineN is the number of the first line in the menu or -1 if no line number is associated with the menu. Returns 0 if the menu doesn’t exist, else returns a pointer to the MDFS structure for the menu.
FormMenu(MDFS,Proc,nil)
rebuilds a menu by initializing and then calling Proc(ItemStream,MDFS). Proc builds each item in the menu by writing text on ItemStream and calling MarkMenus. Usually, composite procedures discussed below are used to do this.
MarkMenus(Action)
is called to mark the last text output to ItemStream as a menu item such that Action gets called when that text is bugged. Marks as a null menu item if Action is 0. Advances to the next line in the menu region if no text has been output to ItemStream. Finishes by reseting ItemStream.
* @WsMarkA(Action)
appends the name of Action to ItemStream and calls MarkMenus; then marks a single blank as a null Action.
* WssMAct(Action)
appends the name of Action to ItemStream and marks Action for execution.
* WssMark(Name,Action)
appends the string Name to ItemStream and marks action for execution.
MenuMChange(NewSelRgn,InRgn,NewMB,MBunion)
is called by DriverLoop() in MRgn.Bcpl when the currently selected region is a menu region and the mouse buttons or character position changes.
deSelectMenu(R)
is called by DriverLoop() when the mouse moves out of the selected region and the selected region is a menu region.
MMPRGN.BCPL (resident name-value menu management and actions)
* UpdateMPDValues(AlwaysOnly)
must be called after register values change. UpdateMPDValues() loops through all of the MPD menu areas on the display and for each one that isn’t empty calls MGetRegData or MGetMemData to obtain the current value. If the new value differs, it sets a flag so that the text in that menu area will be rebuilt later by MPDEveryTime(..). The AlwaysOnly argument is normally omitted; when it is true, only those MPD items that have AlwaysUpdate true in MEMCON/REGCON are updated. This alternate use of UpdateMPDValues aims at machine state that should be polled and updated continuously on the display, even when the machine is running or is at a breakpoint (Most hardware implementations will not have any registers or memories marked with AlwaysUpdate).
MPDdeSelect(MPD)
deselects an MPD menu.
MPDMChange(lvTable,MPD,MBunion,MB)
does the menu switching for the name-value menu MPD in response to the mouse buttons going up and down.
* BadAltIn(TV,DVec,BadStr)
Used as a filler for AltMInput and AltRInput table entries when an alternate input procedure has not been defined.
* RDatatoCSS(RegX,DVec,AVec,ExtRadix)
= DataToStream(CmdCommentStream,form,REGWID!RegX,DVec,Radix)
This is the default pretty-print routine in the AltRInput table, used on registers for which no special print routine is implemented.
* MDatatoCSS(RegX,DVec,AVec,ExtRadix)
=DataToStream(CmdCommentStream,form,REGWID!RegX,DVec,Radix)
This is the default pretty-print routine in the AltMInput table, used on memories for which no special print routine is implemented.
ShowAddr(AVal)
pretty-prints any address item in a name-value menu in standard form and then calls HWShowAddr(X,AVec) to do any additional pretty-printing.
GetRadix(MPD)
returns the radix for the item in the name-value menu MPD.
MMPRGNOV.BCPL (Command overlay)
Implements less common name-value menu actions.
MCMD.BCPL (resident command menu, error handling, etc.)
* WnsCSS(N) = Wns(CmdCommentStream,N,0,8)
* WnsCSSD(N) = Wns(CmdCommentStream,N,0,10)
* WnsCS1(N) = Wns(CmdCS1,N,0,8)
* WnsCS1D(N) = Wns(CmdCS1,N,0,10)
* ConfirmAct(Str,TV)
temporarily turns on display (if off) and prints on the command comment line first Str, then TV, and finally " [Confirm]". Returns false if not confirmed else true if confirmed, display restored to original state.
* DisplayError(S1,S2,S3,NoCSS)
is called by action procedures to show an error message on the display and wait for the user to abort or continue. If called during Midas initialization, it does a CallSwat(S1). Otherwise, unless the fourth arg NoCSS is passed it does ResetsCSS(). Then it shows S3 (if given) followed by S1 on CmdCommentStream and calls BeginError. S3 and S1 explain the error. S2 is an optional string which will be a selectable item to allow continuation. The only other selectable item aborts.
* ErrorExit(S1,S2,S3)
does CallSwat(S1) if it occurs during Midas initialization. Otherwise, it shows S1, S2, and S3 on CmdCommentStream, if given. Then, if the call occurs during a command file or when the display is off it calls DisplayError(0,0,0,true). Otherwise, it aborts the command overlay (if any) or returns to the last ErrorProtect call (if no command overlay).
* ErrorAbort(S1,S2,S3)
similar to ErrorExit, called by procedures that are not in command overlays; exits to the last ErrorProtect call; a procedure distinct from ErrorExit is needed so that actions erroneously executed during a command overlay (such as SetValue) will be aborted without aborting the command overlay.
* SetAbort(lv Proc,Arg)
binds the "Abort" action (alternatively, control-C) to Proc, where Proc is frequently CmdAbort.
* SetAbortPure(lvProc,Arg)
same as SetAbort except that CmdCommentStream and CmdCS1 are not reset at the onset of the action.
CmdAbort(nil,nil,nil)
procedure frequently bound to the "Abort" action. It does ResetsCSS(), prints "XXX" on CmdCommentStream, and then aborts the command overlay or (if not command overlay) the last ErrorProtect call.
* FormCmdMenu()
Rebuilds the command menu.
ShowActions(Act1,FirstAct,NActs)
calls WsMarkA(Act) for Act = Act1 and for the NActs actions starting at FirstAct in the ActionBlock.
* StartLargeOverlay(lvProc,A1,A2,A3,A4)
is used to execute an action in a very large command overlay. Proc is called first to build the actions; Proc returns lv XProc as its result, where XProc is in a different overlay; OverlayZone is cleared after Proc returns. Then a large amount of extra storage from the stack and sysZone is added to OverlayZone and StartCmdOverlay(lv XProc) is carried out; overlays are flushed, extra storage from sysZone released, and OverlayZone rebuilt after StartCmdOverlay returns.
* StartCmdOverlay(lvProc,A1,A2,A3,A4)
is used to call a procedure which returns a procedure for forming an alternate command menu. The alternate menu is used until some action in that menu calls QuitCmdOverlay.
* QuitCmdOverlay(Val)
is called by some action in an alternate command menu to exit from the original call to StartCmdOverlay and resume the normal command menu; Val is returned to the caller of StartCmdOverlay (DisplayError and ErrorExit return 0 to the caller of StartCmdOverlay.).
RestoreState(FP,reinitFlag)
restores "state" from the file with file pointer FP, which should correspond to either Midas.RunProg or Midas.Dtach written by CmdWriteState. reinitFlag is true when RestoreState is called as part of program initialization, false when call is to reinitialize for RunProg. It finishes with GotoLabel(TopFrame,Resume,0) which sends control to the Resume label in the InitRes procedure in Midas.Bcpl.
* CmdCommentStream
A stream for writing comments to the first comment line; ResetsCSS, PutsCSS, WssCSS, WnsCSS, and WnsCSSD are procedures that execute standard stream operations on CmdCommentStream.
* CmdCS1
A stream for writing comments to the second comment line; ResetsCS1, PutsCS1, WssCS1, WnsCS1, and WnsCS1D are procedures that execute standard stream operations on CmdCS1.
TextCmdOutStream
if non-zero, a stream on which DoAction should write logical actions.
ShowActionForm
if true, then the command file form of each action will be shown on the second comment line each time a new action is selected.
SavedLoadText
Vector of ScreenWidth words retaining file names of last load for use by subsequent Dump
LoadDone
True to enable the "Dump" action (after a previous load)
ProgramStream
One text-line stream between the register display and the command comment line on which the name of the last program loaded is displayed. Initially, the release dates of the machine-independent and machine-dependent parts of Midas are displayed here.
CmdAltMenuP
Non-zero if an alternate command menu is up (needed by TxtBNewChar to check for illegal type-ahead).
MCMDOV.BCPL (Command overlay)
Implements action procedures referenced only in xxActions.Asm. These actions are only executed during command files.
MBRKP.BCPL (Brkp overlay)
InsertBreak(MBunion,AVec,MemX)
is an action procedure called from StartWithAddr to insert a breakpoint (The machine-dependent BreakIML procedure does the work).
RemoveBreak(MBunion,AVec,MemX)
like InsertBreak but removes a breakpoint.
MGO.BCPL (Resident--SS, Go actions)
* CallWithAddr(lv Proc,MBunion,nil)
is an action routine used to collect an address from the input text line and then do either DummyCall(lv Proc,MBunion), if the input line is clear, or DummyCall(lv Proc,MBunion,AVec,MemX), if the input line evaluates to an address in MemX. Used to call SingleStepM (SS action), InsertBreak (Brk action), and RemoveBreak (UnBrk action).
* StartWithAddr(lv Proc,MBunion,nil)
like CallWithAddr, but uses StartCmdOverlay instead of DummyCall. Used to call StartM ("Go" action), RepeatGo ("RepGo" action), RepeatSS ("RepSS" action), and OpcodeStep ("OS" action) for Dorado.
* StartBigOvlWithAddr
like CallWithAddr, but uses StartLargeOverlay instead of DummyCall. Used to call StartSim (SimGo action for Dorado).
* HaltWait(nil)
The EveryTimeList procedure which waits for the machine to halt and calls MStopped(true) when it does; meanwhile updates the compute time on the display. Used by the indefinitely-computing Go actions.
* HaltWaitMenu(nil,nil)
Menu-forming procedure that shows an alternate command menu consisting of the single action "Abort."
DetachMenu(nil,nil)
Menu-forming procedure that shows both "Abort" and "Dtach."
* StartSetup(EveryTimeP,EveryTimeA)
binds the "Abort" action to the HaltProc procedure, adds EveryTimeP(EveryTimeA) to the Every-Time List, and returns DetachMenu as its value.
* HaltProc(nil,nil,nil)
used as the "Abort" action for all the indefinitely-computing "Go" actions (includes "Call", "OS", and "SimGo" on Dorado).
@CantContinue
The static used as a one-word bit table in which each bit represents a reason why it is impossible to continue execution of the microprogram from its last breakpoint or keyboard halt. Manifests in MCommon.D include both machine-independent and machine-dependent definitions for the bits. The MStopped procedure in xxGo.Bcpl first clears CantContinue and then may set some bits, if reasons for not continuing are detected; other procedures "Or" reasons into CantContinue. The SetupIMA procedure in xxGo.Bcpl will print the various reasons and wait for confirmation if the user tries to continue.
MGOOVL.BCPL (GoOvl overlay--Call)
* StartWithArgs(lvProc,MBunion,nil)
is an action procedure used to collect the starting address and arguments for the "Call" action. If FOO(a1,a2, ... , an) are on the input text line, FOO is evaluated to a memory address stored in CallAVec!0 and CallAVec!1 and the MemX for FOO in CallAVec!2. a1 to an are evaluated to 32-bit integers stored in a vector. Then StartCmdOverlay(lvProc,MBunion,AV,n) is called where AV contains the arguments.
MRGO.BCPL (RepGo overlay)
RepeatGo,RepeatSS actions
MLOAD.BCPL (Loader overlay--load, compare, dump)
InitLoad(lvProc)
brings in loader overlay and invokes lvProc after initialization, where lvProc points at one of the following:
LoadMB(Ld action) Loads .MB files specified by input text
LoadSyms(LdSyms action) Loads symbols only
LoadData(LdData action) Loads data only
DumpMB(Dump action) Dumps microprocessor state on .MB file specified
by input text under control of .MB files used for previous
LoadMB, LoadSyms, or LoadData.
CompareMBCompares microprocessor state against .MB file
where .MB file must not have any fixups.
MPATTERN.ASM (Resident--in Debug overlay except on Dorado)
* CheckData()
Increment double-precision LoopCount; then compares the DataVec’s of size TValSize in ShouldBe and DataWas. If bits selected by BitsChecked are unequal, then accumulate failure information in AddrIntersect, AddrUnion, BitsPicked, BitsDropped, and TestFailures (discussed in user manual), and return -1; otherwise, return 0.
* NextData()
Generates the next data pattern of size TValSize (as selected by SetPattern) and stores it in the DVec ShouldBe.
@RANDIX
variable used by the random number generator (must not smash it).
@PATTERN
variable used to control NextData but available for other uses at other times (used extensively by pretty-print procedures).
RanTab
Vector of length RanLen used in random number generation.
RanLen
Length of RanTab.
MDEBUG.BCPL (Debug overlay)
* GetPattern(NumActs,DebugProc)
Creates the data-pattern-select Actions, sets the command abort action to be the TestStop procedure, and returns DebugMenu to StartCmdOverlay. DebugMenu is then called to build the pattern-select menu. After a selection is made, DebugProc is called from DebugMenu to display the test-select menu (or whatever). NumActs is stored in the static NActs, then used by DebugProc.
* ShowPattern(S1,S2,Radix)
Prints S1, S2, " with ", the pattern name, and ", mask = " on CmdCommentStream; then it prints BitsChecked using the format vector for the item being tested.
* SetupPattern(DMask,Name,Radix)
The caller must initialize BitsChecked when the new item being tested differs from the last; also, the caller must put a right-justified "1" into IncV. SetupPattern will then mask BitsChecked by DMask and use IncV in controlling the SEQUENTIAL, CYC0, and CYC1 patterns; it initializes LoopCount, AddrUnion, AddrIntersect, TestFailures, BitsDropped, and BitsPicked and sets up ShouldBe for the data pattern. It then resets CmdCommentStream and calls ShowPattern.
* ErrorStop(str1,str2,AVec)
is used to print a message on CmdCommentStream and exit from a test. CmdCommentStream is reset, the str1 and str2 are printed, and finally AVec (a double-precision integer) is printed (if given).
WriteComment()
Resets and then writes the strings pointed to by STAT1 and STAT2 on CmdCommentStream; if STAT3 ne -1, it is also printed onto CmdCommentStream as an octal number
* SaveDGen()
saves the state of the pattern generator in the Vec60 table.
* RestoreDGen()
restores the state of the pattern generator from the Vec60 table.
* ContinueGen(lvProc,Arg)
is used to continue a previously-aborted test. This is called when <esc> has been typed after a test was aborted or halted due to an error.
MDEBUGASM.ASM (Debug overlay)
PatTab
Table of self-relative pointers to the names of the data patterns that appear in the menu of possible data patterns
NPatterns
MTEST.BCPL (Test overlay)
All of these action procedures are called from StartCmdOverlay. Testing of registers, memories, and other items is controlled by the "TestAll" bit in REGCON/MEMCON tables and by the various tables in xxTestAsm.Asm.
DataTest(nil,nil)
defines all actions in the "Test" menu and the data-pattern-selection menu; returns the result of GetPattern as the menu-forming procedure.
ContinueTest(nil,nil)
implements <esc>action after interrupted "Test".
FreeRunTest(nil,nil)
implements <cr> action after interrupted "Test".
TestAll(nil,nil)
implements the "TestAll" action.
ContinueTAll(nil,nil)
implements <esc> after interrupted "Test-All"
SkipTAll(nil,nil)
implements the <cr> action after interrupted "TestAll".
LastVal
MFIELDLP.BCPL (Field overlay)
Implements the "Fields" action
MCOLLECT.BCPL (LDRtest overlay)
* CollectLDR(Vec,MemX)
Collects a list of up to six addresses from the input text line and ensures that they are in MemX; if not ErrorExit is called. This procedure is provided for use by any machine-dependent actions that require lists of addresses (used for "LDRloop" action on Dorado).
MPESCAN.BCPL (PEscan overlay)
PEScan() implements the "PEscan" action
Those memories that contain parity (indicated by bit in MEMCON) appear in a menu that allows the user to select which ones are scanned for parity errors. ScanForPE(MemX,WaitP,Vec) is called for each memory selected.
* ReportPE(Vec,NPEX,DVec,MemX,AVec,WaitP)
is called by ScanForPE to report parity errors. Vec, MemX, and WaitP are the arguments passed to ScanForPE by PEscan; AVec is the address in the memory (double-precision vector); NPEX is ...
MPRINS.BCPL (resident--procedures for pretty-print overlays)
PrinV0(String,Value)
prints "String=Value" on CmdCommentStream, where Value is a 16-bit integer printed in the default radix (DefRadix).
PrinV1(String,Value)
like PrinV0 using CmdCS1.
NWss(String,BitMask)
prints "String" on CmdCommentStream iff (PATTERN & BitMask) ne 0, where the BitMask argument is defaulted to NextPattern if omitted; then does NextPattern = BitMask rshift 1.
NWss1(String,BitMask)
like NWss using CmdCS1.
xxACTIONS.ASM (resident--table of Actions)
Defines many statics that point to actions
ActionBlock
points at the first action in the table.
ActionPtr
the number of actions currently in the table.
LastAction
FirstCmdAction,LastCmdAction
point at the first and last actions that are in the primary command menu.
NHWCFActions,HWCFActions
HWCFActions points at the first RdCmds action for the file Special.Midas; NHWCFActions is the number of entries to Special.Midas.
EscAction,NewEscAction,CRAction,NewCRAction
are manipulated by DoAction(..) in MMenu.Bcpl and by the test stuff (potentially elsewhere) to determine which action is executed in response to the user typing <cr> or <esc>.
@LongOne,LongMinOne.
xxTABLES.ASM (resident--register and memory tables)
Defines register and memory description tables discussed earlier.
xxREG.BCPL (resident--register read-write)
PutRegData(RegX,DVec)
Returns false if writing register RegX is illegal; otherwise, stores DVec into RegX and returns true; comments similar to PutMemData apply.
MPutRegData(RegX,DVec,nil,Extension)
If writing is legal, then calls PutRegData(...), restores incidentally clobbered registers, calls UpdateMPDValues, and returns true; otherwise, calls ErrorExit().
GetRegData(RegX,DVec)
fetches register RegX into DVec and returns true if ok, false if the value cannot be obtained for some reason.
MGetRegData(RegX,DVec,nil,lvExtension)
Calls GetRegData(...), restores incidentally clobbered registers, and returns true if ok, false if the value cannot be obtained for some reason.
xxMEM.BCPL (resident--memory read-write)
CertifyAV(MemX,AVec)
Is called from EvalAText to verify that AVec contains a legal address in MemX; returns true if ok else false (in D1ASM.ASM).
PutMemData(MemX,DVec,AVec)
stores DVec in MemX, AVec. Returns true if operation went ok, else false. PutMemData, which does not restore registers clobbered incidentally, is called directly by Ld and LdData actions and by Test actions, where speed is more important than cleaning up; in most other contexts, MPutMemData is used instead. Even though it doesn’t have to restore registers, PutMemData must leave the hardware in operable shape and not clobber any memory words except those considered to be volatile during program execution.
MPutMemData(MemX,DVec,AVec,Extension)
If AVec is a legal address in MemX and writing is legal, then calls PutMemData(...), restores incidentally clobbered registers, calls UpdateMPDValues(), and returns true; otherwise, aborts with ErrorAbort. Since CertifyAV has verified the legality of AVec, the reason for failure will normally be something such as read-only violation, can’t write because machine is running, etc. Extension is 0 and ignored except for items that extend to more than one MPD region on the display (see the ROW or PIPE memories in Dorado Midas for how Extension is used).
GetMemData(MemX,DVec,AVec)
fetches data from AVec in MemX, stores the result in DVec. Returns true if successful, else false; volatile registers used in the course of the Get are not restored. GetMemData is called directly by Dump and Test actions; in most other contexts MGetMemData, which restores registers clobbered during the Get, is called.
MGetMemData(MemX,DVec,AVec,Extension)
If AVec is a legal address in MemX and reading is legal, then calls GetMemData(...), restores incidentally clobbered registers, and returns true; otherwise returns false.
xxRES.BCPL (resident--register memory read-write)
FormHWMenu()
builds conditional parts of the machine-dependent command menu (Unconditional menu items are in the part of ActionBlock managed by FormCmdmenuText).
DetachHardware()
called to do any machine-dependent stuff needed for the "Dtach" action (called "Boot" on D0 Midas); called by FinishHardware and by Init2.
FinishHardware()
Routine called before Midas exit to the Executive.
HWShowAddr(MemX,AVec)
called from ShowAddr in MMPrgn.Bcpl to do special additional pretty-printing for the "Addr=" action.
HWAlwaysUpdate(MorRCON,X,AVec)
returns 1 if the memory or register identified should be "always updated" on the display; MorRCON is the contents of the MEMCON/REGCON table entry for the memory/register; this procedure is needed because some of the addresses in the MADDR memory are always-updated while others are not, so cannot simply check the MEMCON/REGCON bit to decide.
xxBRKP.BCPL (BrkP overlay)
BreakIML(AVec,MemX,BPflag,String)
is called from InsertBreak with BPflag true and from RemoveBreak with BPflag false; AVec eq 0 if the address should be defaulted, else MemX and AVec define the address at which the break point should be inserted or removed; String, then " break at ", then the address are printed on CmdCommentStream.
xxGO.BCPL (resident--procedures called by MGO.BCPL)
SetupIMA(GoP,AVec,MemX,NA,String,MBUnion)
is called by RepeatGo, RepeatSS, SingleStepM, and StartM. It prints String followed by other information on CmdCommentStream if the address is ok and aborts otherwise. GoP is a predicate meaning go full speed if true, single-step if false. AVec and MemX are the address information for the go or step. NA is 1 if AVec should be defaulted to continue from the last break, else 3. MBUnion distinguishes a "new go" from a "continue"; by convention BottomButton is true when the control section should not be reset before starting; otherwise, io devices and the control section should be reset, so that only the task being started is active. The static GoVec is a vector in the form of the GoVec structure in MCommon.D (which contains both machine-independent and machine-dependent stuff); (GoVec>>Go.Proc)(GoVec) is called before returning; the caller will then start the machine with OneStep(GoVec>>Go.RunP).
MStopped(GoFlag)
Is called when Go, SS, Call, OS, RepGo, or RepSS terminate. It should setup to read the machine state, and print on the comment lines information about the location of the halt and reason for halting. If the GoFlag argument is true, then the reason for halting is printed. If the GoFlag argument is true or omitted from the call, then exit with QuitCmdOverlay().
DefaultGoMemory()
Establishes the default memory for a Go, SS, etc. action so that number;G on the input text line will be evaluated to an address in the correct memory.
OneStep(GoArg)
is called after SetupIMA has done the primary setup for a Go, SS, etc. It either starts the machine running full speed or single-steps it, according to GoArg.
Stop()
Halts the hardware, assumed to be running (in D1ASM.ASM).
@CheckStopped()
Returns true if the hardware is running, else false (in D1ASM.ASM).
xxLOAD.BCPL (Loader overlay)
PrepareLoad(SymOnly)
Verify that the hardware is in good shape for a Ld, LdData, LdSyms, Cmpr, or Dump action and do other setup. Call DisplayError if probably not ok to execute the action; if DisplayError returns (indicating user wants to go ahead with the operation), then call ResetsCSS().
RestoreAfterLoad()
cleans up after Ld, LdData, LdSyms, Cmpr, or Dump actions; checks for errors detected during the Ld and calls ErrorAbort if there were any problems, else returns.
PutMDSymOnly(MemX,DVec,AVec)
kludge routine replacing PutMemData on the LdSyms action. This is needed on the Dorado and D0 implementations of Midas so that the virtual memory table can be loaded; other implementations of Midas will probably define this as a no-op.
AddToVM(VA,DVec)
Discussed below in the xxVM.BCPL section (part of the virtual control store stuff used for Dorado and D0 implementations).
LoadCleanUp()
Called after a load to build inverted symbol tables for use by the FastSearch procedure.
xxDEBUG.BCPL (Debug overlay)
QuitTest()
is called by ErrorStop. It should prepare for subsequent calls to MGetRegData and MGetMemData, call UpdateMPDValues and exit with QuitCmdOverlay.
xxTEST.BCPL (Test overlay)
ValidateTest(X)
Sets up for testing the register, memory, or other item denoted by X, where X = 0 to NREGS-1 denote registers, NREGS to NREGS+NMEMS-1 denote memories, and NREGS+NMEMS to NREGS+NMEMS+NOther-1 denote other tests.
Other procedures implementing the "other-test" items.
xxTESTASM.ASM (Test overlay)
Defines tables for "Test" and "TestAll" actions discussed earlier.
xxFIELD.BCPL (Field overlay)
FieldLoop(FieldX)
Should make the hardware execute the microinstruction setup by SetupFieldTest(..) and ModifyField(..).
SetupFieldTest(FieldX)
Should prepare a no-op microinstruction for subsequent modification by ModifyField(..) and execution by FieldLoop.
ModifyField(Bit1,NBits,Value)
Modifies the selected microinstruction field.
xxFIELDASM.ASM (Field overlay)
NFields contains the number of fields in a microinstruction
FieldTab
a table of self-relative pointers to field names indexed by FieldX (0 to NFields-1 are indices)
FMaskTab
FBit1Tab
xxPESCAN.BCPL (PEscan overlay)
ScanForPE(MemX,WaitP,NPETab)
Scans memory MemX for parity errors. NPETab is a vector in which a summary of results is reported. NPETab!0 is the displacement to the next unused word of this vector. The items in NPETab are three words long, with word 0 accumulating the error count and words 1 and 2 pointing at strings that are printed after the error count. Hence, if the memory has only one parity error, it would set words 1 and 2 to point at " in " and MEMNAM!MemX, and these will get printed as part of the summary. If the memory has several parity error bits, it will use several different 3-word NPETab entries. NPETab!0 is incremented past the words that are used. Calls ReportPE for each error.
xxVM.BCPL (resident code for managing virtual control store and fast symbol search)
LookUpAA(VA,DVec)
Returns the absolute address AA corresponding to a virtual address VA; returns #137777 when there is no corresponding AA. When the optional DVec argument is provided, the AA field in that DVec is filled in with the AA.
LookUpVA(AA,lvPtr)
Returns the VA corresponding to AA or #137777 if no corresponding VA; if the optional lvPtr arg is passed with the call, it is filled in with a pointer to the AAtab table entry, so that other information associated with the VA can be obtained (irrelevant if no corresponding VA).
SetVirtP(Flag,nil,nil)
Called both as an action ("Virt" and "Abs") and directly; Flag is true to enter virtual mode, false to enter absolute mode. The second and third arguments are passed only when SetVirtP is called as an action; their presence causes UpdateMPDValues and FormCmdMenu to be called.
RetrieveBlock(TablePtr,Kind,Strategy,Block,InitVal)
Used to create and retrieve record file blocks associated with the VA←AA, AA←VA, and FastSearch operations. TablePtr!0 contains BlockAddr if the block already exists, else 0. If the block exists, GetBlock(TablePtr!0,Kind,Strategy,Block) is called to get the block into core. The InitVal argument is passed with the call only when a new block should be created if no old one exists; in this case, if TablePtr!0 contains 0, MakeNewBlock(NPagesPerStandardBlock,Kind,Strategy,Block) is called to allocate the block on the record file and initialize its BlockTable entry; then all the words in the block are initialized to InitVal. The core address of the block with BlockAddr as its record file index is returned.
FastSearch(Addr,MemX)
is called by SearchBlocks to obtain the symbol record file block containing the largest address symbol in MemX less than or equal to the address Addr (limited to single-precision). FastSearch returns 0 if the answer is not known; otherwise it calls GetBlock to bring the selected block into core and returns the core address.
IMstab, etc.
Tables containing BlockAddr’s for the inverted symbol tables used by FastSearch.
@VirtualP
True in virtual mode, false in absolute mode.
VAtab
Table containing record file BlockAddr’s for the data structure used by LookUpAA.
AAtab
Table containing record file BlockAddr’s for the data structure used by LookUpVA.