Page Numbers: Yes X: 530 Y: 10.5" First Page: 1 Not-on-first-page
Margins: Top: 1.3" Bottom: 1"
Heading: Not-on-first-page
D0 Midas ManualEdward R. Fiala3 January 1980
D0
MIDAS MANUAL
3 January 1980
by
Edward R. Fiala
Xerox Palo Alto Research Center
3333 Coyote Hill Rd.
Palo Alto, CA. 94304
Filed on: [Ivy]<D0Docs>D0Midas.Press
Sources on: [Ivy]<D0Source>D0MidasManual.Dm
This manual describes a largely machine-independent loader/debugger for microprocessors originally developed for the Maxc2 computer and since used for the Dorado, D0, and M68 microprocessors. This manual is specialized for the D0 version of Midas.
This manual is the property of Xerox Corporation and is to be used solely for evaluative purposes. No part thereof may be reproduced, stored in a retrieval system, transmited, disseminated, or disclosed to others in any form or by any means without prior written permission of Xerox.

TABLE OF CONTENTS
l.Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.Storage Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.Starting and Exiting from Midas . . . . . . . . . . . . . . . . . . . . . 4
4.Midas Display and the Mouse . . . . . . . . . . . . . . . . . . . . . . 5
5.Name-Value Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6.Command Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.Keyboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
8.Command Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
9.Syntax of Command-file Actions . . . . . . . . . . . . . . . . . . . .13
10.Registers and Memories Known to Midas . . . . . . . . . . . . . .15
11.The IM Memory and Virtual Addresses . . . . . . . . . . . . . . .16
12.Registers and Memories that Contain Microinstructions . . . .17
13.Task-Specific Registers . . . . . . . . . . . . . . . . . . . . . . . . . . .18
14.Memory System Registers and Memories . . . . . . . . . . . . . .19
15.Loading Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
16.Dump and Compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
17.Break, UnBreak, ClrAddedBPs, ClrAllBPs, and ShowBPs . . .21
18.Go, SS, and Continue . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
19.When Registers Are Read/Written--
Restrictions on Continuing . . . . . . . . . . . . . . . . . . . . . . . . .22
20.Hardware Failure Reporting . . . . . . . . . . . . . . . . . . . . . . . .23
21.Testing Directly From Midas . . . . . . . . . . . . . . . . . . . . . . .23
22.Command Files Used With "Read-Cmds" . . . . . . . . . . . . . .26
LIST OF TABLES
Table l:Command Menu Actions . . . . . . . . . . . . . . . . . . . . . 8
Table 2:Command File Name-Value Actions . . . . . . . . . . . . .12
Table 3:Command File Command Actions . . . . . . . . . . . . . . .13
Table 4:Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Table 5:Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
Table 6:Test Data Pattern Actions . . . . . . . . . . . . . . . . . . . . .24
Table 7:Test Items in the Name-Value Display . . . . . . . . . . . .24
Table 8:Command Files . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
Figure l:Midas Display

l. Introduction
Midas is a loader/debugger that runs on an Alto and controls its target machine remotely. It can load/dump microprograms assembled by Micro, examine and modify storage, and test hardware in several ways. Versions exist for Maxc2, Dorado, D0, and M68 microprocessors.
Midas is coded about 95% in Bcpl and 5% in assembly language. The Maxc2 version was implemented by E. R. Fiala and H. E. Sturgis. The Dorado, D0, and M68 versions consist of machine-independent modules implemented by E. Fiala (Overlay and LoadRAM packages implemented by L. Deutsch and Alto microcode by E. Taft are also used) and machine-dependent sections implemented by E. Fiala for Dorado; D. Swinehart and P. Baudelaire for M68; and D. Charnley, C. Thacker, B. Rosen, C. Hankins, and E. Fiala for D0.
An internal description of Midas is available to anyone interested in adapting Midas to a new hardware system (see [Ivy]<DoradoDocs>MidasInternal.Press).
2. Storage Requirements
Midas requires about 500 Alto disk pages, using the following files:
Midas.Run~350 pages
Midas.Syms
~40 pages
Midas.Errors
~8 pagesError message strings for Midas swat calls
Midas.Programs
~2 pages(Discussed below)
Midas.UserPrograms
~2 pages(Discussed below)
*.Midas
~2 pages eachCommand files for "RunProg" and "Read-Cmds" actions
*.mb
Assorted micro-binary files loaded by command files
Midas.RunProg
~31 pagesBuilt by Midas/I
Midas.Dtach
~31 pagesBuilt by Midas/I
Midas.FixUps
~2 pagesCreated by Midas/I (used when loading .MB files)
Midas.Compare
~2 pagesCreated by Midas/I, written when "Compare" fails
D0 Midas can be obtained by loading [Ivy]<D0>D0MidasRun.Dm and retrieving <D0>Midas.Programs with Ftp. You must do Midas/I to initialize Midas on your disk after retrieving these. Subsequently, new versions of Midas can be retrieved by executing the D0NewMidas.Cm command file from the Alto Executive. Midas runs only under OS versions 17 or later.
To setup an Alto disk for use in D0 microcode development or hardware debugging, you can install the Alto OS on a blank disk using the long installation dialog and erase the disk. When this finishes, fetch [Ivy]<D0>D0DebuggingDisk.Cm and execute this command file from the Alto Executive; it will retrieve Midas and a number of other files needed when using an Alto for D0 hardware debugging and microcode development.
3. Starting and Exiting from Midas
Midas may be started from the Alto Executive in the following ways:
midas/iinitializes (required when any Midas files move or change);
midassimply fires up Midas;
midas debugstarts Midas and immediately reads commands from the "Debug.Midas" command file
Note: You are required to type midas/I when you change any of the files "known" to Midas; these files include the Alto OS, Midas.Run, Midas.Programs, Midas.Midas, Midas.UserPrograms, any of the *.Midas files that appear in the "Run-Prog" or "Read-Cmds" menus, and any of the *.Mb files used by the "Run-Prog" menu items.
At present, Midas will boot its connected D0 at startup. The "Boot" action, which appears in both the main command menu and the submenu put up by "Go," will cause the D0 to load and start its boot loader (which overwrites any microprogram previously loaded); Midas then communicates with the boot loader to load its Kernel microprogram, which resides in parts of pages 0, 16, and 17 of the microstore; subsequently, interactions between Midas and the D0 are carried out by messages exchanged between the Kernel microprogram and Midas using the Alto’s Diablo printer interface.
The locations used by Kernel are available to microprogrammers through the file KernelOccupied.Mc which is in [Ivy]<D0Source>KernelSources.Dm; there are provisions for overwriting most of Kernel when running large microprograms.
In the initial display arrangement, the left-hand display column shows the principal D0 registers, and the right column shows several other items. When you initially start Midas and after a "Run-Prog" action, the display will be set to this configuration.
To exit from Midas you may type either SHIFT-SWAT (i.e., simultaneously depress the left-hand shift key and the right-most, lowest unmarked key) or ";Q" or you may bug "Exit"; this will close any open output files prior to exit. Note that on exit, if the D0 was running, it will not be disturbed.
4. Midas Display and the Mouse
The Midas display is arranged as follows:
Blank area at the top (unused);
20 lines x 3 columns of name-value menus;
Blank line;
Program and elapsed time line;
Blank line;
Two command comment lines;
Blank line;
Three lines of command menu;
Blank line;
Input text line;
Blank area a the bottom (unused).
The program line will show the Midas release date or the name of the last program loaded. The right-most part of this line will show elapsed time during long-running actions such as "Go" or "Test"; it shows the execution time of Midas initialization, the last command file, or the last action at other times.
Midas uses the two comment lines to report results of actions that it executes.
When you move the mouse over a name-value menu or the command menu, the selected item (if any) inverts black and white. Mouse actions execute when you RELEASE all mouse buttons, so you can move the mouse with buttons depressed without causing damage. If the mouse has moved off of the menu that was selected when the first button went down, nothing will happen when the buttons are released.
Some menus have additional actions "underneath" the ones normally displayed which will appear when you depress appropriate button combinations, as discused below. In other words, when you DEPRESS buttons, the menu may change; when you RELEASE ALL BUTTONS the selected action will get executed. On D0 Midas, only name-value menus have actions underneath the ones normally displayed.
Since you can neither depress a button combination simultaneously nor release the buttons simultaneously, Midas accumulates the union of all buttons that go down. This button-union governs the "underneath" menu displayed, if any, and is the argument passed to the action procedure when all buttons are finally released.
5. Name-Value Menus
A name-value menu may contain a register or memory address in the name area and its contents in the value area. A memory address may be specified as the memory name and word number, or as the name of an address symbol defined in a microprogram you have loaded. The address symbol may be followed by +/- displacement. If a number (default radix 8) is examined, the memory name is defaulted to "VM," so examining "1234" will cause "VM 1234" to be displayed.
Name-value areas are of different sizes. Smaller menus on the left are already filled in when you fire-up Midas; others are empty. Any item can be put in any menu, but larger menus on the right are better for items with long names or values. If an item overflows its menu, the right-most characters of its name get truncated, then the left-most characters of its value.
To display a new item, type its name (which will appear on the input text line), move the mouse over the name field in a name-value menu, and push-and-release the left (top) mouse button. Memory addresses in your microprogram may optionally be followed by a displacement "+n" or "-n"; " n" is the same as "+n". Midas will obtain the value of the item from the hardware and display it.
If the command line is empty, the selected menu will be cleared when the button is released.
The address and data items in a name-value menu are affected by the radix and display mode for the item, initially defaulted from a table indexed by the register or memory number. The address offset and value radices are always identical--Midas does not allow these to be independently specified. On D0, octal radix is the default for everything; the user may change the radix with the actions discussed below.
The display mode for a value may be either numeric, search, or symbolic.
Numeric mode shows the value as a sequence of numbers (in the chosen radix) separated by blanks; this is the default for all items.
Search mode shows the value as an address symbol plus offset; this is illegal except for registers or memories that normally contain pointers into some other memory (e.g., on D0, search mode for CIA, TPC, APC, or CALLER shows the nearest IM address symbol less-than-or-equal to the value plus an offset). Search mode is not the default for any memory or register because it is slightly slower than numeric mode due to symbol table access and because more screen area is required to accommodate long address symbols; however, you may find search mode convenient for some of the items mentioned above.
Symbolic mode results in a special procedure being called to print the value for the item; special procedures do not exist for any registers or memories on D0.
When Midas thinks that the value in a register may have changed, it reads its value from the hardware and updates the display; the times when Midas does this are discussed later. Names are sometimes preceded by *, indicating that the value has changed, or by ~, indicating that Midas was unable to read the value for some reason (e.g., the machine was running). For an item marked with ~, the old value, which might be wrong, is displayed.
Once some register or memory address has been put into a name-value menu, various mouse button combinations over the name or value may be used to modify the way it is displayed, sequence through words in a memory, pretty-print the value on the comment lines, or show address equivalences. These are summarized in the table below:
ButtonsName-fieldValue-field
LeftExamineChange value
MiddleAlternate printoutPretty-print value on comment lines
RightA+1, A-1 menuAppend value to input line
Left+MiddleRadix menuRadix menu
Middle+RightFill column menuDisplay mode menu
When a button combination selects an alternate menu, the alternate menu will replace the standard menu while the mouse buttons are depressed; if you release the buttons over an alternate menu item, it will be executed; if you are outside the menu when the buttons are released, the standard menu will be restored and nothing will happen.
The "A+1", "A-1" menu appears for memory addresses, but not for registers; these increment or decrement the memory address in the menu, displaying the successor or predecessor. The "FillC" menu allows you to examine successors (A+1, A+2, etc.) in the menus below the selected one; the whole column is filled with successors, if the input text line is blank; otherwise, the input text line is evaluated to a number N, and N lines are filled in with successors. The last address examined is left on the input text line, so you can iterate the examine and fill column actions to achieve scrolling.
Releasing the left button over a value stores the value of the input text (or 0 if no text typed) in the selected register. For memories and registers whose values are displayed as several fields, the input text must also be divided into fields; omitted fields are zeroed. Each field may consist of numbers or memory addresses separated by +/-; expressions are evaluated using the radix for the item.
Note: On D0 and Dorado, IM memory words show an absolute address with each value; it is impossible to modify this address from Midas--the correspondence between virtual and absolute addresses can only be established by loading a microprogram. Several other items also have read-only fields that cannot be written, as discussed later.
Provision is made for special input evaluation based upon the register or memory; whenever the input text cannot be evaluated as a sequence of fields, the special input procedure (if any) is called. At the present time, special input procedures are implemented for registers and memories that contain microinstructions (IM, IMX, and MIM on D0) and for 16-bit registers. These are discussed later.
Releasing the middle button over a value pretty-prints the value on the command comment lines. The alternate for registers that normally hold IM addresses is the nearest IM address tag less-equal to the value+offset. Registers and memories that contain microinstructions may also be printed symbolically. Other pretty-print information is detailed later.
Releasing the right button over a value item appends the text of the value to the input text line. This is primarily used in command files to move values from one register to another or to display a memory address that is pointed to by the value in some other register.
6. Command Menu
The command menu holds a list of actions that Midas can execute. The basic menu is modified under some conditions. For example, the "Dump" menu item only appears after you have done a "Load". During execution, some actions show alternate menus.
For all D0 actions in the command menu, mouse buttons are equivalent. Many common actions may alternatively be initated by keyboard command characters, as given in the action table below.
Table 1: Command Menu Actions
InputCharMenu ItemComments
Actions (potentially) available on all implementations of Midas
[File]Run-ProgReset symbol table, breakpoint table, and display, then do Read-Cmds.
[File]Read-CmdsExecutes command file (def. ext. ".Midas") on input text line or from submenu.
Show-CmdsShows command file text for selected menu items.
FileWrite-CmdsWrite subsequent commands on File.
Files;LLoadLoads .MB files (names separated by ",").
FilesLdSymsLoads only addresses from .MB files.
[File];DDump# Dumps compacted .MB file using the .MB file(s) of the previous load to control what’s dumped.
[File];CCompare# Compares hardware data to that in .MB file.
Addr=Prints value of an address (illegal in com-file)
IMaddr;BBreakInserts break point.
[IMaddr];KUnBreakRemoves breakpoint (default address = last break).
[IMaddr];GGo* Start at address (continue if nothing typed).
;CContinue* Start at address without IOReset or control section reset (continue from break if nothing typed).
;PContinue* (makes ";P" and ";C" synonymous)
[IMaddr]:SS* Single-step at address (continue-step if nothing typed).
[IMaddr];SSS* So ":" and ";S" are synonymous.
Test* Test register, memory, or other test with data pattern and item selected from submenus.
Test-AllTest everything.
VirtualChanges IM address interpretation to be virtual.
AbsoluteChanges IM address interpretation to be absolute.
Actions peculiar to D0 Midas
BootBoots the D0 and resets Midas as for Run-Prog
ClrAddedBPsClears all breakpoints added since the last Load.
ClrAllBPsClears all breakpoints.
ShowBPsShow BP’s added since the last Load.
;QExitExits cleanly from Midas--";Q" and Shift-Swat are synonymous.
* = requires preceding "TimeOut" action in command file
# = requires confirmation with <cr>, "Y", or "." (or by preceding "Confirm" command in com-file)
[...] = optional input text
Some actions in the preceding table are replaced with complementary actions after execution; these are Show-Cmds by Conceal-Cmds, Write-Cmds by Stop-Write-Cmds, Virtual by Absolute.
General philosophy on mixing keyboard and mouse button control is that, when possible, a command involving some typing is carried out completely at the keyboard, whereas commands involving mouse buttons are carried out completely with the mouse.
For example, to start a microprogram at some address, you normally type an address; then you could bug "Go" in the command menu, but probably "address;G" is more convenient because you won’t have to lift your hand from the keyboard; ";G" are the command characters equivalent to bugging "Go".
Many commands are executed in overlays. When these get executed, the register display will turn off (The code for overlays resides where the display bit buffers would otherwise be.). During loading or execution of command files, the display is turned off to make the machine run faster.
Long-running commands normally display an "Abort" menu item. When this is bugged or when control-C is typed, the action terminates.
7. Keyboard
"=", "+", "-", "#", and "!" are legal symbol constituents in microprograms but will cause trouble for Midas if they appear in address symbols. "=" is an action character that will prettyprint the memory name and offset and the nearest address symbol less-than-or-equal to the value of the string on the input text line. "+" and "-" have their usual sum and difference meanings in evaluating input expressions. "#" (octal), "!" (decimal), and "%" (hexadecimal) may be inserted anywhere in a number to overrule the default radix; e.g., "#123" or "123#" will force the evaluation of the number "123" to be in octal. The default input/output radix for everything on D0 Midas is 8 (octal).
Lower case typein is converted to upper case by Midas, so avoid lower case characters in microprogram address symbols. You should write microprograms with the shift-lock key depressed or assemble them with the convert-to-upper-case assembly switch.
Typing ahead is legal until the character you type would cause execution of an action. After that, Midas will flush input and blink at you until the current action finishes.
At the end of an action, input text typed for that action is displayed on the input text line. This text remains valid and can be used as the arg for another mouse action. However, if you type any character (except control-A or backspace), the old input will be flushed before inserting the new character.
Keyboard editing characters are as follows:
control-Adelete last character
backspace
delete last character
control-Q
clear text line
del
clear text line
Other special keyboard characters are as follows:
control-Cabort the current action--equivalent to bugging the "Abort" command (only defined for actions that display "Abort")
control-Zabort a command file
escaperepeat previous action (special for "Test" and "TestAll")
returnspecial following "Test" or "TestAll"
control-Dturns on the display (used during command files)
control-Oturns off the display (used during command files)
shift-swatexit cleanly from Midas
The interrupt characters above are ineffective during loading, dumping, or comparing, which typically take between 2 and 20 seconds. Indefinite duration commands, such as "Go", "Test", etc. always monitor the keyboard, so control-C can be used to terminate them.
Control-Z, control-D, and control-O are intended for use during command files. However, these characters do not take effect until the command file executes a command such as "Go" which monitors the keyboard. There is no way to abort a command file and give control back to Midas safely except during a "Go" or other long-running command. This is not expected to be a problem because commands are executed quickly.
After interrupting a "Go" with control-C or control-Z, proceeding with ";P" or ";G" will succeed except when you have smashed the machine state by writing a register or in some other way or have interrupted an instruction from which continuation is impossible.
Although command menu items "SS," "Go," "Continue," "Break," and "UnBreak" are provided, the keyboard characters equivalent to these are usually more convenient.
8. Command Files
Command files (default extension ".Midas") are normally executed either by typing "Midas filename" to the Executive or by bugging a file name in the subsidiary menus put up by "Run-Prog" or "Read-Cmds". Alternatively, you may type a file name first, then bug one of these actions (If you type a file name after the subsidiary menu is put up and then bug "Abort", the command file will also be executed; it is not clear whether this is a bug or a feature.).
File names in these sub-menus are contained in the files Midas.Programs and Midas.UserPrograms, each of which has a list of file names separated by blanks, commas, or carriage-returns. Midas.Programs is part of the standard Midas release; Midas.UserPrograms is an optional file that a user of Midas can prepare with his own stuff. The names must be UPPER-CASE. These lists serve two purposes: building file FP’s to speed OpenFile, and preparing the menu items for "Run-Prog" and "Read-Cmds".
If the file name contains no extension, then hint FP’s will be built for both name.MB and name.MIDAS and name will be put in the "Run-Prog" menu. (However, the hint FP’s are not built unless the file exists, and the file name will not be put in the "Run-Prog" menu unless name.MIDAS exists).
If the name ends in "*", a quick OpenFile table entry is made for name.midas and the name will appear in the "Read-Cmds" menu.
If the file name contains an extension, then it will be put in the quick OpenFile table, but won’t appear in the "Run-Prog" or "Read-Cmds" menus.
Since Midas builds a table of file FP’s during its initialization, when you edit a command file or modify a .MB file, you should reinitialize Midas by typing "Midas/I". When you add new command files or .MB files you should update the "Midas.UserPrograms" file appropriately and do "Midas/I".
"Read-Cmds" executes the actions stored in the command file; it is frequently used to modify the display in various ways by executing command files that show collections of items that are of interest.
"Run-Prog" first clears the symbol table and restores the display to its initial arrangement; then it executes the actions in the selected command file; "Run-Prog" is used to completely change contexts--to run a new microprogram, for example.
Generally, there is one "Run-Prog" command file for each hardware diagnostic, with the same name as the diagnostic, e.g.:
dgbasic.mbthe diagnostic;
dgbasic.midas
the command file.
A command file following this convention loads the diagnostic into the microprocessor and displays various registers of interest when the microprogram is in use.
The command-file facility is actually an (awkward and limited) programming language. The collection of actions discussed below is being developed so that command files can monitor diagnostic microprograms, collect and report error information on an output file, or direct the sequence of diagnostic microprograms according to hardware failures that are observed.
For system microcode, command-files can be used to control auto-restart and failure diagnosis.
Command files can be nested with "Run-Prog" and "Read-Cmds" subject to the following RESTRICTIONS:
(1) [Maxc2 only] "AltIO" terminates command files (i.e., upon return to Midas from AltIO the command file will not be continued).
(2) Nesting is limited to 8 levels (a parameter that could be increased if more levels are needed).
A number of actions, some of which cannot be given interactively, are useful in command files. These, not given in the table earlier, are shown below. The first table is for actions that operate on name-value menus (A0 ... C19); the second table for command menu (X) actions.
Table 2: Command File Name-Value Actions
Text ArgActionComments
AddressAddrButton actions as discussed earlier.
ValueValButton actions as discussed earlier.
A+1Increment memory address, as discussed earlier.
A-1Decrement memory address, as discussed earlier.
NColsFillCFill name-value menus beneath the one selected with consecutive addresses starting at the address contained in the selected menu.
OctDisplay address offset and value in octal.
DecDisplay address offset and value in decimal.
HexDisplay address offset and value in hexadecimal.
NumDisplay value numerically.
SymDisplay value symbolically.
SearchDisplay value as an address symbol plus offset in the appropriate memory.
ValueSkipESkip the next command if the input text evaluates equal to the contents of the register or memory word displayed. The input text is evaluated exactly as though it were to be stored into the register displayed in that name-value menu, so if the value displayed has several fields, the input text must also have several fields.
ValueSkipGSkip if input text greater than the contents of the item in the name-value menu (unsigned compare).
ValueSkipLSkip if input text less than name-value item.
ValueSkipNESkip if input text unequal to name-value item.
ValueSkipLESkip if input text less than or equal name-value item.
ValueSkipGESkip if input text greater than or equal to name-value item.
Table 3: Command File Command Actions
Text ArgActionComments
Octal no.SkipSkip N following commands, where N is the value of the input text.
.TagSkipSkip following commands until one is encountered with the label ".Tag".
Octal no.BackSkip
.TagBackSkipReset to byte 1 of the command file, then skip.
Octal no.ReturnReturn out of current command file, then skip (".Tag" form is illegal for Return.).
DisplayOnTurn on the display, so that effects of subsequent commands can be observed. The display is initially off for a command file.
DisplayOffTurns off the display.
Octal no.TimeOutInput text is evaluated to a 32-bit octal number of msec at which to abort the immediately following command, if it has not finished by then. This is intended for use before "Go" and other commands which might hang indefinitely. If the timeout occurs, Midas will skip the command after the "Go". TimeOut also turns on the display, necessary because the machinery which checks for timeout is only active with the display on. Note that TimeOut is required before the actions *’ed in the table on page 4 and is illegal before other commands; Midas will complain if you do not use TimeOut appropriately.
ConfirmSupplies confirmation for the command which follows (which should be one of the commands requiring confirmation).
File nameOpenOutputOpens an output file (default extension ".Report") on which text can be written.
File nameAppendOutputAppend to an output file (default extension ".Report")
CloseOutputCloses the output file.
[text]WriteMessageWrites the contents of the input text buffer on the output file. Note that if any text follows the WriteMessage, that text up to but not including the <cr> is what gets written. However, if <cr> immediately follows WriteMessage, then the contents of the input text buffer left by the previous command get written. "~" is translated into <cr> and "\" into a blank.
WriteDTAppends the current date and time to the output file.
textShowErrorDisplays the text arg on the command line, turns on the display if it was off, and queries with "Abort" and "Continue" menu items.
--DumpDisplayWrites the current display image on the output file.
textPrettyPrintEvaluates text to a memory address, register name, or memory name; writes this name on the output file; then pretty-prints the value on the output file exactly as it would be pretty-printed on the comment lines if the item were displayed in one of the name-value menus and middle-buttoned.
File nameWriteStateUsed by Midas initialization to create the Midas.Dtach and Midas.RunProg files--users shouldn’t use this action.
9. Syntax of Command-file Actions
The syntax of a command-file action is as follows:
[["."<tag>]$" "]<buttons>$" "<menu>$" "<action>[$" "<text>][";"<comment>]<cr>
where the "[]" denote that the ".tag", input text, and ";comment" are optional. $" " denotes a sequence of one or more blanks and tabs.
If the first character on the line is a ".", then the characters after that are a label or tag which may be used as the argument for the "Skip" or "BackSkip" actions given in the table earlier.
<buttons> may be any combination of the letters "L" (left-button), "M" (middle-button), and "R" (right-button); these are the buttons released to execute the action. These may appear in any order.
<menu> is the menu name in which the action is executed ("X" for the command menu, "A0"..."A19", "B0"..."B19", and "C0"..."C19" for name-value menus).
<action> is the text name for one of the actions (upper/lower case must match the definition).
<text> is the text typed on the command line, which may be anything except a ";".
Note that if a single blank terminates <action> and if no input text argument is given, then input text left-over from the preceding action will be used. This allows text from a right-button action over a value to be used in a following action (e.g., in WriteMessage or to store the value into another reigster). However, one or more extra blanks will reset the input text, so the action is executed with null input text.
";" begins a comment, which may be omitted.
<cr> (carriage-return) terminates the action.
To find out what text should be put in command files, you can bug "ShowCmds" in the command menu. This will cause the command file text for each command to be displayed on the command comment line as the mouse selects it (You don’t have to execute the command to see the equivalent text.). This text is complete except that the mouse button which executes the command isn’t shown unless you depress the mouse button. To terminate "ShowCmds", bug "StopShow" (which appears only when "ShowCmds" is in progress.).
You can prepare a command file (default extension ".Midas") by typing a file name and bugging "Write-Cmds". This causes text for subsequent commands to be put on the file. When you are done with this, bug "Stop-Write-Cmds" to close the file. ("Stop-Write-Cmds" is in the command menu only when a command file is being written.). Exiting from Midas also closes the output file.
You will probably want to edit out your goofs with Bravo after the command file is written.
In addition, you will have to insert "Confirm" before actions which require confirmation and modify the "TimeOut" stuff which Midas uses to surround actions which might hang indefinitely (See the table given earlier for the actions that require this.).
Here is a sample command file:
L X Load DG1;Equivalent to typing "DG1" and bugging "Load" in the command menu
L A0 Addr CTASK;
Examine the "CTASK" register in name-value menu A0
L A0 Val 0;
Change the value in CTASK to 0
L A1 Addr RTEMP;
Examine the address "RTEMP" in menu A1
L A1 SkipE FOO+3;
Skip the next command if RTEMP contains the value FOO+3
L X ShowError RTEMP not loaded correctly
L A2 TPC 0;
Examine the TPC register for task 0 in menu A2
L X TimeOut 2000;
Abort the following command if it hasn’t finished in 1.024 sec.
L X Go START;
Begin microprogram execution at address "START"
L X Skip 1;
Skip the next command if "Go" halts before timeout
L X ShowError START;G failed;
Show an error message