£Hex`Debug`Monitor ("Hexmon") Program User Guide  Preliminary Documentation, May 1994  () 1994 Esquimalt Digital Logic Inc. All Rights Reserved.  £Orientation The system debugger is for use by software developers and others whohave a thorough working knowledge of OMEn and computers systems ingeneral. Users are advised not to run Hexmon, or at least not to useit to write directly to memory, without knowing the ramifications ofthe operation being performed. Hexmon is provided in the Systemfolder for ease of access during debugging operations. This debugger dates from the early '80s on a 6809 system. Theinterface is somewhat unusual, but it allows access to memory and I/Oports in a direct non file`oriented manner different from all otherOMEn utilities. Looking at the Hexmon window, the "Commands" area is at the top, andthe memory display occupies the rest of the window. At the left arethe addresses of the locations being viewed. Towards the right is thecontent of that memory location, viewed in hexadecimal as 16 bitwords. At the far right is the same contents viewed as two ASCIIcharacters. "Hexmon" takes single keystroke commands. Clicking on the appropriateword in the command area at the top of the window also performs thesame function, but not all functions are available by mouse clicks.Several commands not shown in the command area can only be accessedby keyboard. Commands which take a numeric parameter obtain it from the value mostrecently entered, which is shown in the center of Hexmon's display aseight hexadecimal digits instead of four. Values are typed in inhexadecimal. It is important to remember this sequence: enter the numberfirst, ¥then¤ select the desired function. For example, to search forthe bytes "$F12345", type the number and make sure the data numbersays $00F12345, ¥then¤ press "S" to search from the current address. In addition, addresses may be dragged into Hexmon from other sourcesusing the mouse. Hexmon has a "Help" window (just type ) that explains most of itsfeatures and operation in brief on the screen. As with all OMEnsoftware, pull the Hexmon window to the front to make sure thatkeystrokes are received by the Hexmon program.  £Hexmon Commands Here is the list of commands accepted by Hexmon. -- Entering new addresses -- The commands below allow for absolute positioning in memory or formovement relative to the present location. View address given in data Keeping same upper 16 bits, view address given in Lower 16 bits of data. <+>add the value given in data to the address <->subtract the value given in data from the address <>The DownArrow key advances Hexmon's current address to the next word of memory past the current word. <>UpArrow puts Hexmon's address back by one word. Go to. This jump indirect" command accesses the current word of memory and the word following as a 32 bit address and jumps the view to that address. This is useful for locating a memory allocation from its allocation handle address, instead of having to type the digits visible in the view and .   -- Storing Data into Memory -- Hexmon always writes 16 bit words of data, which is either useful orannoying depending on the size of the actual desired write. Write the data into the current location and then advance the address to the next word in memory. Write the data into the current location without changing the current location. Useful for I/O areas where advancing might cause a bus error. (In I/O areas it is sometimes neccessary to shrink the window to one line displayed in order to avoid bus error locations.)  -- Searching for binary values in memory -- Sequences of one, two, three or four bytes may be located in memory.Search is always from the current memory location upwards. The firstbyte of the sequence must be non-zero. Search for the sequence given in data. Typing "000000AB" would search for the next occurrance of the byte AB hex. "00152F3Dew to those addresses. This can be highly usefulfor debugging software under development by allowing the programmerto view items such as the stack (user or supervisor), items pointedto by any register, and the code being executed. (On the wish list isa disassembler for viewing the code in assembly language format. Adisassembler that understands and names OMEn system calls and I/Ocalls would be extra useful.) In addition to import of values, Hexmon can export its currentaddress or the current data (t address import sources are file directories andregisters in the crash-debug window. When a file is dragged in, Hexmon's view address jumps to the head ofthat file. Hexmon does not, however, read in the file if it is ondisk; it simply points to the file's header. In conjunction with thefile header definitions, programmers can inspect file headers toascertain that they contain the appropriate information for the file. Dragging in addresses from the crash window of a program beingdebugged jumps the view to those addresses. This can be highly usefulfor debugging software under development by allowing the programmerto view items such as the stack (user or supervisor), items pointedto by any register, and the code being executed. (On the wish list isa disassembler for viewing the code in assembly language format. Adisassembler that understands and names OMEn system calls and I/Ocalls would be extra useful.) In addition to import of values, Hexmon can export its currentaddress or the current data (the 8 digit number). To export thecurrent address, drag it from the left side of Hexmon's display area.To export the value typed in, drag from the right hand side. The most useful current places to drag addresses and values to are toregisters in the crash window and to the background window. Dragging to the crash window can change a register to a new value fordebugging. Unfortunately, the "access address" does not currentlyaccept new values, so it is not possible to change this and proceedafter a bus error or address error. Dragging to the background window simply prints the value on thescreen in decimal; a quick means of converting hexadecimal todecimal. £Bus Error and Address Error Recovery Most programs which execute a bus or address error end up at thecrash window. Hexmon changes the vector of these errors for itself tospecial handlers which allow it to recover from them. When an erroris presented, such as an address that causes a bus error, a specialwindow opens up showing the address with up arrows () above it anddown arrows () below it. Clicking on the appropriate arrow increasesor decreases that digit of the address until an address is found thatdoesn't cause a bus error; then the window exits back to the regularHexmon window. Hexmon operates in supervisor mode, so it has access to addresseswhich may cause bus errors in user mode programs, depending on themake and model of the computer. (For example, Atari computersgenerate a bus error with any user mode access of vector space,protecting it from most errant programs.) In the case of I/O port addresses, it sometimes occurs that addressesboth before and after the I/O port will cause bus errors. In thiscase, Hexmon's window must be shrunk so that there is only one linein the data display part of the window in order that that be the onlyaddress accessed in displaying the window. Use the command towrite to the port without advancing to the next word. The bus errorhandling feature has been used to easily locate all the video I/Oregisters in one particular computer model.