Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!rex!ames!haven!mimsy!midway!ellis.uchicago.edu!dwal From: dwal@ellis.uchicago.edu (David Walton) Newsgroups: comp.sys.mac.misc Subject: Re: Using the Programmer's Switch Keywords: crash 'n restart Message-ID: <1990Dec18.204110.16211@midway.uchicago.edu> Date: 18 Dec 90 20:41:10 GMT References: <1053@sppy00.UUCP> <1990Dec18.052752.8420@cs.umn.edu> <1990Dec18.164136.14761@csus.edu> Sender: news@midway.uchicago.edu (News Administrator) Organization: University of Chicago, Academic and Public Computing Lines: 80 In article <1990Dec18.164136.14761@csus.edu> swansond@cube05.csus.edu (Dennis Swanson) writes: [Assorted questions and info about the ROM Debugger deleted] >I'd also like to see a list of handy/fun things to type into >this window, and/or the subset of macsbug commands the built-in supports. Any- >one out there in the know? >| Dennis M. Swanson | INTERNET: swansond@csus.edu | Herewith, an explanation of the ROM debugger commands, shamelessly cut-and- pasted from Tech Note #38. (It's a bit long, yes, but not so much so that I thought it would be harmful to post it in its entirety.) ======================================================================= The debugger in ROM (not present on the Macintosh 128, Macintosh 512, or Macintosh XL) recognizes the following commands: PC [expr] (program counter) Typing PC on a line by itself displays the program counter. Typing PC 50000 sets the program counter to $50000. SM [address [number(s)]] (set memory) Typing SM on a line by itself displays the next 96 bytes of memory. Typing SM 50000 will display memory starting at $50000. Typing SM 50000 4849 2054 6865 7265 2120 will set memory starting at $50000 to $4849I Subsequently hitting Return will increment the display a screen at a time. DM [address] (display memory) Typing DM on a line by itself displays the next 96 bytes of memory. Typing DM 50000 will display memory at $50000. Subsequently hitting Return will increment the display a screen at a time. SR [expr] (status register) Typing SR on a line by itself displays the status register. Typing SR 2004 sets the status register to $2004. TD (total display) Displays memory at the RmagicS location $3FFC80, which contains the current values of the registers. The registers are displayed in the following order: D0-D7, A0-A7, PC, SR. G [address] (go) Executes instructions starting at address. If G is typed on a line by itself, execution begins at the address indicated by the program counter. NOTE: If you want to exit to the shell, you just need to type: SM 0 A9F4, then G 0 NOTE: If you crash into the debugger and the system hangs, try turning off your modem. ================================================ Some folks have already mentioned how to exit to the Finder (either 'SM 0 A9F4', 'G 0' or 'G Finder' will work). You should probably restart using the Finder's Restart command after doing this, because the System will most likely be in an uncertain (read unstable) state. You can also (sometimes, depending on how nasty your crashes were) restart the machine from the ROM debugger by entering SM 0 3F3C 0002 A895 G 0 You can shut down the machine completely by substiting '0001' for '0002'. (Thanks to earlier incarnations of the THINK Pascal manual for that tip.) -- David Walton Internet: dwal@midway.uchicago.edu University of Chicago { Any opinions found herein are mine, not } Computing Organizations { those of my employers (or anybody else). }