Maxc2 Midas OperationMaxc Operations209. MAXC2 MIDAS OPERATIONMidas is the loader/debugger used for the Maxc2 microprocessor. It has features for directly testingthe Maxc2 hardware through the maintenance interface, for loading/dumping microprogramsassembled by Micro, and for examining and modifying the storage in the microprocessor. It cancontrol the microprocessor and memory power supplies, configure the memory, and enable/disablethe various memory error correction-detection stuff. It also has a command for calling AltIO, theI/O program used by Tenex.9.1. Starting MidasTo start Midas, simply say "Midas" to the executive or, more generally, "Midas com-file".Midas command files have the extension ".Midas". Generally, there is one command file for eachof the hardware diagnostics, with the same name as the diagnostic, e.g.:dgbasic.mbthe diagnostic;dgbasic.midasthe command file;midas dgbasicto the Executive executes the command file.These command files load the diagnostic into the microprocessor and display various registers whichare of interest when the microprogram is in use.In addition, there are the following command files:midas/iinitializes (should be executed whenever any Midas files move orchange, or when a new Alto Operating System is installed).midas/rcontinues with the symbol table and display saved at the last call toAltIO.midassimply fires up Midas.midas tenloadloads the Tenex microcode.midas tengoloads Tenex microcode and calls AltIO to start Tenex.midas mexecgoloads Tenex microcode and calls AltIO to start MicroExec.midas initloads new Tenex microcode and sets checksums.midas debugloads some special symbols for use with "Constructed-Test" (seebelow).If you are already running Midas, and you want to switch microprograms, you can bug the "Run-program" menu item and then bug the name of the command file in the subsidiary menu whichcomes up. The "loader" menu item simply initializes a new Midas. "debug" is used to prepare forthe "Constructed-test" stuff discussed later.9.2. Midas DisplayAt the top of the Midas display are a number of register name-value menus. Below these are thename of the last microprogram loaded, the command comment line, the command menu, and the)fqX;pi `rX ]Ks?& [*- YZ W5) V!J TV Mr J#sY FE DHAu X? = + :nK 80 51X318/:.*1,_*( ' 5%5 9#j -! ! cW 7"  S - Cr sH %4 >]LMaxc OperationsMaxc2 Midas Operation21input text line. When you move the mouse around, the menu item selected (if any) turns black.Note that mouse actions execute when you release the mouse button, so you can move the mousearound with the button depressed without causing damage. If the mouse position does not selectany screen item, nothing happens when the button is released.Register areas are of different sizes. Smaller areas are already filled in with various microprocessorregisters when you fire-up Midas. The unused ones at the right and bottom left of the display areappropriate for 36-bit stuff, but only the bottom right items are large enough for IM (instructionmemory) stuff.To display a new item, type its name, move the mouse to one of the register name areas, and push-and-release the left (or top) mouse button.If the command line is empty, the selected register area will be cleared when the button is released.When you push the right (bottom) mouse button over a name area in which an address is displayed,a subsidiary menu appears as follows:A+1 A-1"A+1" increments the address, displaying the next location. "A-1" decrements the address.Releasing the middle button over an address item shows alternate forms of printout on thecommand comment line. If the input text line is non-empty, it will first display that item.Releasing the left button over a value item, evaluates the input text and stores the value (or 0 if notext typed) in the selected register. The input text is limited to octal numbers with interspersedspaces permitted for readability.Releasing the middle button over a value item shows an alternate display of the value on thecommand comment line. The alternate for IMA, NPC, and STK values is the nearest IM addresstag less-equal to the value+offset (the value is also put on the input text line, so you can examinethat location in the display area if you want to). For DM, DM1, and DM2 words, the alternate isthree IM addresses with offsets and one flag. For IM the alternate is a symbolic printout of themicroinstruction.Releasing the right button over a value item appends the text of the value to the input text line.9.3. Midas Command MenuFor the command menu, all mouse buttons are presently equivalent (this may change). For mostcommon commands, equivalent input text sequences carry out the same action, as given below.The general philosophy on mixing keyboard and mouse button control is that, when possible, acommand involving some typing is carried out completely at the keyboard, whereas commandsinvolving mouse buttons are carried out completely with the mouse. fpi6KqXFp _s5) ]Kts, [O Y= VD9. Ty?# Rb P MrP K+ H6Xe D9' B%? <XZ 8U 6\ 3gZ 1V /! ,_X *A (5/ 'D %5Y #j Xb 8r sJ [ C H B B >[^Maxc2 Midas OperationMaxc Operations22Many of the commands are executed in overlays. When these get executed, the register display willturn black (the code for overlays resides where the display bit buffers would otherwise be). Duringloading and during execution of command files, the display is turned off to make the machine runfaster.Many of the commands put up a succession of subsidiary menus with assorted options as discussedbelow.The long-running commands normally display an "Abort" menu item. When this is bugged orwhen control-C is typed, the action terminates.InputKeyboardMenu ItemComments;QExitQuit to Executive.FileRead-CmdsExecute command file (default extension ".Midas").Show-CmdsShow equivalent command file text for selected menuitems.FileWrite-CmdsWrite subsequent commands on file.;AAltIOCall AltIO with options (terminates command file).Run-ProgramRun selected microprogram (restricted use in commandfiles).Files;LLoadLoad .MB files.FilesLoadSymsLoad only addresses from .MB files.File;DDump2Dump compacted .MB file using the .MB file(s) of theprevious load to control what's dumped.File;CCompare2Compare microprocessor data to data specified in .MBfile--compare file must have been created by Dump.Addr=Print value of an address (illegal in command file).IMaddr;BBreakInsert breakpoint. (Restarting from the breakpoint willsucceed in all situations except when a memory write orread-modify-write has been given and MDR not yetloaded with the correct data or when the disk controlleris active.)[IMaddr];KKill-BreakRemove break at address (at IMA if nothing typed).[IMaddr];GGo1Start at address (continue at IMA/NPC if nothingtyped).)fqX;pi  _sJ ]K\ [=# Y VDU Ty QK O=/ KrX'FHYs'F D'F2Au'F3'F? <8 'F"8'F25U 'F4'F3 0'F ,'F# )4)u'F)4s4'F'i' #$u'F#s4'F"-2 'F4 I'F8'F~8'F0'F8'F  'F2 ; u'F ;s0'F p| )=\Maxc OperationsMaxc2 Midas Operation23InputKeyboardMenu ItemComments[IMaddr];PGo1Same as ;G (mnemonic "Proceed", provided forcompatibility with Maxc1 Midas).[IMaddr]:StepSingle-step at address (at IMA/NPC if nothing typed).See caveats on breakpoints above.[IMaddr];RRepeat-Go1Go at address, repeat endlessly after halts.[IMaddr];SRepeat-Step1Repeatedly step at address.LMPEscanScan all local memories (IM, SM, DM, DM1, DM2) forparity errors.Power-On1Turn on power (see below).Power-Off1Turn off power (see below).LDRaddrsConstructed-Test1(see below).Test1Test register or memory (see below).Field-Loop1For scoping (see below).Test-All1Test everything (see below).1 Requires preceding "TimeOut" command in command file.2 Requires confirmation with , "Y", or "." (or by preceding "Confirm" command in command file).9.4. KeyboardThere are a number of characters which are legal symbol constituents in microprograms but whichwill cause trouble for Midas when they appear in addresses.Lower case typein is converted to upper case by Midas, so avoid lower case characters inmicroprogram identifiers. I recommend writing microprograms with the shift-lock key depressed.Avoid "=" in identifiers. "+" and "-" are ok so long as the following character (if any) is a letter.Typing ahead is legal until the character you type would cause execution of a command. After thatMidas will flush input and blink at you until the current command finishes.At the end of a command the input text typed for that command is displayed on the input text line.This text remains valid and can be used as the argument for another mouse action. However, ifyou type any character (except control-A or backspace), the old input will be flushed beforeinserting the new character. fpi6KqXFp _r'F [s\1u'F[s,'FY Vg'F5'FT! Q+Qu'FQ+s, M NFu'FMsJG'F2'FH| E Eu'FE sAB%u'FAs >&>u'F>&s :;Au'F:s$7B 7u'F7Bs34]u'F3s 1u0suF5 --3sXuFY &sr #s_ !6; !7 &9 /f b K &< M 7%  >\2 Maxc2 Midas OperationMaxc Operations24Keyboard editting characters are as follows:control-Adelete last characterbackspacedelete last charactercontrol-Qclear text linedelclear text lineOther special keyboard characters are as follows:control-Caborts the current actioncontrol-Zaborts a command filecontrol-Dturns on the displaycontrol-Oturns off the displayThe interrupt characters above are ineffective during loading, dumping, or comparing, whichtypically take between 2 and 15 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, thesecharacters do not take effect until the command file executes a command such as "Go" whichmonitors the keyboard. There is no way to abort a command file and give control back to Midassafely except during a "Go" or other long-running command. This is not expected to be a problembecause commands are executed quickly.After interrupting a "Go" with control-C or control-Z, proceeding with ";P" or ";G" will succeedexcept when the conditions discussed earlier for breakpoints apply.Although command menu items "Step", "Go", "Break", "Kill-Break", "Repeat-Step", and "Repeat-Go" are provided, you will normally find it more convenient to execute these from the keyboardusing the alternate command characters.9.5. Command FilesCommand files have default extension ".Midas". They are normally executed by typing "Midascom-file" to the executive or by bugging the name of a command file from the subsidiary menu putup by "Run-program". However, you can also execute a command file by typing a file name andbugging "Read-cmds" in the command menu.To find out what text should be put in command files, you can bug the "Show-Cmds" item in thecommand menu. This will cause the command file text for each command to be displayed on thecommand comment line as the mouse selects it (you don't have to execute the command to see theequivalent text). This text is complete except that the mouse button which executes the commandisn't shown unless you depress the mouse button. Usually the text "L " precedes the text given by"Show-Cmds", indicating that the left (or top) button was pressed and released to carry out thecommand. "M " precedes a middle-button command and "R " a right-button (or bottom-button)command. The name of the command is followed by a blank, then the command line text, andfinally a carriage return. To terminate "Show-Cmds", bug "Conceal-Cmds" (this only appears inthe command menu when "Show-Cmds" is in progress).)fqX;pi  `sX,]K[YW Ty1QO=MrK H65& Fk)9 DH A.I ?dO => ;$< :& 6L 4C 1U\ /U -' 'r #s4' !` = .( V I '^ \K 9) Q 6$ 2 L gC 2 V U=]Maxc OperationsMaxc2 Midas Operation25You 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 aredone with this, bug "Stop-Write-Cmds" to close the file. ("Stop-Write-Cmds" only appears in thecommand menu when a command file is being written.) You will probably want to edit out yourgoofs with Bravo after the command file is written.For command files associated with big programs, the symbol table is not entirely in core, so youmay want to sort the command-file addresses in reverse-alphabetical order to minimize symbol-tableswapping. Currently, Midas has barely enough symbol table space to hold all of the Tenexmicrocode's addresses, so none of the symbol blocks have to be swapped. However, this maychange if more features are added to Midas or to the Tenex microcode.Command files can be nested several levels (limited by the size of sysZone which must be bigenough to accommodate OpenFile and buffers for the command files already open). However,there are the following restrictions:(1)"AltIO" terminates command files (i.e., upon return to Midas from AltIO the command file willnot be continued).(2)"Run-Program" is illegal except in the top level command file. ("Run-Program" resets Midas,then calls "Read-Cmds". This reset operation smashes the symbol table, the display, and the stackback to their initial state. Hence, if you were to execute "Run-Program" from a subsidiarycommand file, that command file would be continued, but the higher level ones would not, and thesysZone buffers for the higher level command files would not be released.)Extra s can be used in a command file for punctuation, and ";" can be used at the beginning ofa line or after the last character of a command to begin a comment. The comment is terminated by.Since Midas builds a table of file pointers during its initialization, when you edit an existingcommand file or .MB file, you should reinitialize Midas by typing "Midas/I". When you add newcommand files or .MB files you should update the "Midas.Programs" file appropriately and do"Midas/I". The form of "Midas.Programs" is discussed later.There are a number of commands which can never occur when Midas is run interactively, butwhich are useful in command files. These are as follows:Text ArgMenu ItemCommentsOctal no.SkipVEqlSkip the next command if the selected value menu item equalsthe value of the text arg.Octal no.SkipVGrSkip the next command if the selected menu item's value isgreater than the text arg.Octal no.SkipVLsSkip the next command if the selected menu item's value isless than the text arg.Octal no.SkipSkip N following commands, where N is the 16-bit value ofthe text arg. fpi6KqXFp `s;" ^:" ]((8 []W Y3 V!@ TVI RC P3' NE KU I2' Gt s D}2A B ?A2N =vJ ;T 9;% 8J 4-5 2a 1 -O +V *[ (=< $; #9 rX" ss"s<"R s"s:" s"s%" gs"s"  U=]-Maxc2 Midas OperationMaxc Operations26Octal no.BackSkipReset to byte 1 of the command file, then skip.Octal no.ReturnReturn out of current command file and skip N commands inthe calling command file (if any), where N is the 16-bit valueof the text arg.DisplayOnTurn on the display, so that effects of subsequent commands canbe observed. The display is initially off for a command file.DisplayOffTurn off the display.Octal no.TimeOutArgument is a 32-bit octal number of milliseconds after whichto abort the immediately following command, if it has notfinished by then. This is intended for use before "Go",which might hang indefinitely. If the timeout occurs Midaswill skip the command after the "Go". TimeOut also turns onthe display, which is necessary because the machinery whichchecks for timeouts is only active with the display on.ConfirmSupply confirmation for the command which follows (whichshould be one of the commands requiring confirmation).File nameOpenOutputOpen an output file (default extension ".Report") on whichtext can be written.CloseOutputClose the output file.[text]WriteMessageWrite the contents of the input text buffer on the output file.Note that if any text follows the WriteMessage, that text up tobut not including the is what gets written. However, if immediately follows WriteMessage, then the contents ofthe input text buffer left by the previous command are whatgets written. "~" is translated into .textShow-ErrorDisplay the text arg on the command line, turn on the displayif it was off, and query with "Abort" and "Continue" menuitems.The "right-button" value action allows the current values of any register to be appended to theinput text buffer. This can be used in conjunction with WriteMessage to output various parts of themachine state to the output file.9.6. Loading ProgramsThe "Run-program" command is a short method of executing the most common command files--those which load a microprogram and fix up the display for that program.)fqX;pi  _sXs"s/ [s"s3"Y""XTs"sX?"R>O`s "s Ks"s#"J#1"HY8"F;"D%"B5"A.7=s"s1";6 8s "s&"63Cs "sX /s "s?"."",<6"*r&"(!"&+ #js "s-"!%" cG ] !  r s8 H =[Maxc OperationsMaxc2 Midas Operation27You can also load a program by typing a file name (default extension ".mb") and bugging "Load"in the command menu. However, this should rarely be necessary because all of the microprogramsappear in the menu put up by "Run-program", which additionally reinitializes Midas.It is a poor idea to do a "Load" when another microprogram has already been loaded because thiswill merge symbols from the new load into those already in the symbol table. In addition to beingvery slow, this may overrun the size of the symbol table on the disk (no provision is made forexpanding the symbol table beyond its maximum size).It is also a good idea to assemble microprograms as a single .MB file. Although Midas can loadmultiple .MB files (typed as a list separated by commas), this will cause additional fragmentation ofthe symbol table and thrashing while blocks are swapped in and out.These recommendations follow because Midas takes advantage of alphabetical address ordering in.MB files to pack its symbol buffers nearly full. But when subsequent files are loaded the symbolbuffers will be fragmented to about half-full, symbol buffer swapping will result, and the symbolsearches will be longer.9.7. Dumping MicroprogramsAfter assembling a microprogram, it is a good idea to load and dump it from Midas. Dumpingdeletes all forward reference fixups left by Micro and compacts both data and addresses to use lessdisk space and load more quickly later. Also, undumped .MB files cannot be used with "Compare"because of forward references.Note that only those memory words loaded by the original microprogram are dumped, so youcannot patch unused locations, dump the program, and expect the patches to survive.9.8. Tenex MicrocodeWhen a new release of the Tenex microcode is made, it must be loaded into the microprocessor, thechecksums set, and then dumped onto SYS2. To carry out this initialization, type "Midas init" tothe executive.After dumping, SYS2;C can be used to compare the microstore against its correct contentswhenever the checker program (INIT;G) fails. This is a good way of locating bad storage chipsafter a crash or verifying that the storage is OK before loading some other microprogram.9.9. Power On-OffThe "Power-On" menu item allows the microprocessor, port, and memory to be powered on andtested in various ways. The first "Power-On" subsidiary menu shows the following: fpi6KqXFp _s'7 ]KM [S XF VDL Ty'7 R4 O=N Mre KC H6:$ FkQ DZ B <r 8s:! 6): 5P 3C /!7 .S 'Fr #sH " 7* ? ; <" 8Y wr s9 ;R | =[Maxc2 Midas OperationMaxc Operations28ProcessorTurn on processor and port power only.MemoryTurn on memory and port power only and configure memory.BothTurn on port, processor, and memory cabinets' power.Test-Port-&-ProcessorRepeatedly execute the maintenance interface operations forturning on port and processor power (for debugging powercontrol hardware).Test-Memory-CabinetQuery for a memory cabinet number, then repeatedly executethe I/O instructions for powering on the memory cabinet.After the processor is turned on, the local memories (IM, SM, DM, DM1, DM2) are zeroed toprevent parity errors from occurring.When "Memory" or "Both" is bugged, another subsidiary menu will come up showing the variousoptions for enabling/disabling error correction, core-zeroing, and FER on memory errors. Fornormal use by Tenex, let the default action take place for all of these options, and immediately bugthe "do-it" menu item.Power on takes about 15 seconds because the power supplies take a while to stabilize. After power-on the interrupt system is cleared and the flag register is zeroed.The right-most four nine-bit bytes in CONFIG (appears on the Midas display) control the memoryconfiguration as follows:bits 0-8represent quadrant Jbits 9-17represent quadrant Kbits 18-26represent quadrant Lbits 27-35represent quadrant MA "1" in the byte enables cabinet 0, "2" cabinet 1, "4" cabinet 2, ..., "200" cabinet 7. Hence,CONFIG might be set as follows:3003003003All four quadrants active in cabinets 0 and 1 (would result in 256Kfour-quadrant configuration)17017017017All four quadrants active in cabinets 0-3 (would result in 512K four-quadrant configuration)3000003003Quadrant K disabled, but cabinets 0 and 1 active (would result in128K two-quadrant configuration avoiding quadrant K)Memory power-on does a catastrophic memory reset. This may occasionally clobber memory words,but this complete reset has been required to unhang the memory on several occasions, due toproblems which have not been fixed.)fqX;pi _s"X&["8X2"4T","R ."Q+M"'"K8 H|= F% C@:! Au] ?P = :nc 8C 51W 3g/.* ,_  *  '#00 %X! C  7 m 04 1^ f[ # T=YMaxc OperationsMaxc2 Midas Operation29The first "Power-Off" subsidiary menu is analogous to the "Power-On" menu. Note that the portpower will remain on unless you bug "both" because neither the memory nor the processor isoperable without the port power being on.Please be mindful of the following terrible danger: The microprocessor, port, and memory powermust be turned off before powering down the Alto. When this rule was violated on two occasions,numerous Alto MI chips were clobbered, apparently due to power transients from the cable.To make repairs to the microprocessor, it is sufficient to turn only the processor power off, providedthat neither the PMEMI, KMEMI, nor PMAINT cards are disturbed. For all other maintenance,power down "Both". If you want to remove the PMAINT card, power off the Maxc processor andmemory first, then the Alto disk, and finally, the Alto processor.9.10. Testing Through the Maintenance Interface"Test", "Constructed-Test", and "Test-All" allow the microprocessor to be tested from the Altothrough the maintenance interface. Data patterns for the test are determined from the firstsubsidiary menu, as follows:ZEROESAll-zeroes dataONESAll-ones dataCYC136-bit word of all zeroes with a single-one bit cycled left oneposition each iterationCYC036-bit cycled zero in word of onesRANDOM48-bit random numbersSEQUENTIAL0, 1, ..., sequential numbersALTZOAlternating all-ones and all-zeroes patternsALT-SHOULD-BEAlternating contents of SHOULD-BE with its ones-complementTesting is controlled/described by five addresses on the display as follows:LOW-HIGH(For memory tests only) contains in bits 0-17 the lowestmemory address tested and in bits 18-35 the highest addresstested. Memory tests begin at the low address and seq-uentially test each address up to the high address, then loop.LOOP-COUNTThe number of successful iterations of the test prior to failureor prior to aborting from the keyboard or with the mouse.SHOULD-BEWhat the data should have been.DATA-WASWhat the data actually was.BITS-CHECKEDMask of bits checked (see below).LOW-HIGH delimits the maximum address range. If the memory you select has fewer words thanHIGH, then the maximum for that memory is used. This means that the last address tested for amemory test is as follows (assuming LOW-HIGH is left at its normal maximum value):IMLOOP-COUNT mod 10000 (octal)SMLOOP-COUNT mod 1000 fpi6KqXFp _sD ]KI [) X#tsr VD"s/ TyY Qf O=M MrD KB Dr0 AusC ?R =:n"X8" 6"?"53C""1y"/ "-",, ": (L%5"("#j+"!"! "("@u"" "! n-. ^ R g X   X U=]Maxc2 Midas OperationMaxc Operations30DMLOOP-COUNT mod 1000DM1LOOP-COUNT mod 1000DM2LOOP-COUNT mod 1000RMLOOP-COUNT mod 40LMLOOP-COUNT mod 40STKLOOP-COUNT mod 14"Test-All" automatically loads BITS-CHECKED with a full-sized comparison mask prior to testingeach item. It tests each register 250 times and makes 4 passes through each memory. It is a goodidea to run "Test-All" whenever the hardware is in a suspicious state."Test", after showing the data-pattern menu, shows a menu of register and memory names, andexecutes a test of the one you select until the test fails or you halt the test from the keyboard."Test" masks the current contents of BITS-CHECKED with the maximum-sized mask for theregister or memory being tested. If you previously tested a small register, then you have tomanually load BITS-CHECKED with a full-sized mask before testing a big register. If you don'twant to check all the bits in a register, then clear the bits you don't want to check in BITS-CHECKED."Constructed-test" should only be used when the "debug" command file has been loaded. Thisrequires a sophisticated understanding of the hardware and of the innards of Midas and is notrecommended for novices. Midas makes use of a number of microinstructions while reading,writing, starting, and stopping the microprocessor. "Constructed-test" allows these microinstructionsto be executed in non-standard sequences to beat on particular hardware problems through themaintenance interface. When using "Constructed-Test", a list of LDR addresses is typed (seeDEBUG.MC for the instructions) separated by commas. If only one LDR address is typed, themaintenance interface's BR register is loaded once with the selected data pattern, then the LDRinstruction is repeatedly executed for a scope loop. When two, three, etc., up to six LDR addressesare typed, a test loop occurs whereby BR is loaded with the next data pattern, the list ofinstructions is executed, and then BR is read back and compared against the data under control ofBITS-CHECKED. The loop stops when (data-read-back xor data-sent-out) & BITS-CHECKED isnon-zero."Field-Loop" exercises signal decoding for particular fields of the microinstruction for scope loops.A microinstruction is fabricated from a no-op microinstruction in which the field selected from thefirst subsidiary menu is replaced by various values. The second subsidiary menu allows the value inthe selected field to be incremented, decremented, and shifted.)fqX;pi _s X]K [ Y W V!  RV P[ OF K,/ ID H6 FHL D}@ BA @ =v!: ; S 9.+ 8f 6K\ 4F 2< 0#< /!K -V7# +2/ )E ' $&? "_ d %? >I- TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN !)/5:A Gj/J H}oMaxcOps9.BravoRWeaverJuly 16, 1981 10:31 AM