Hdos Software Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
HDOS SOFTWARE REFERENCE MANUAL HDOS DISK OPERATING SYSTEM VERSION 3.0 CHAPTER 9 CONSOLE DEBUGGER DEBUG CHAPTER NINE CONSOLE DEBUGGER PAGE 9-i ============ ================ ======== HEATH DISK OPERATING SYSTEM SOFTWARE REFERENCE MANUAL VERSION 3.0 HDOS was originally copyrighted in 1980 by the Heath Company. Through the years it continued to be improved by successive revisions which included 1.5, 1.6, and finally 2.0. It was entered into public domain on 19 July 1989 per letter by Jim Buszkiewicz, Managing Editor, Heath Users' Group, P.O. Box 217, Benton Harbor, MI 49022-0217 (616)982-3463. A copy of this letter is available for public inspection. This manual is indicative of further improvements and provides for the latest revision, HDOS 3.0 and HDOS 3.02. Revision 3.0 is detailed in chapters 1, 2, and 3, while chapters 4 ,5, 6, 7, 8, 13 and 14, are related to revision 3.02. Chapters 9 through 12, with minor improvements, are essentially picked up from the original HDOS 2.0 manual. Indeed, HDOS is still alive and well! SPECIAL DISCLAIMER: The Heath Company cannot provide consultation on either the HDOS Operating System or user-developed or modified versions of Heath software products designed to operate under the HDOS Operating System. Do not refer to Heath for questions. Instead, you are invited to direct any questions concerning the Heath Disk Operating System (HDOS) to Mr. Kirk L. Thompson, Editor "Staunch 89/8" Newsletter, P.O. Box 548, #6 West Branch Mobile Home Village, West Branch, IA 52358. CHAPTER NINE CONSOLE DEBUGGER PAGE 9-1 ============ ================ ======== TABLE OF CONTENTS +++++++++++++++++ INTRODUCTION .................................... 9-2 COMPUTER/USER DIALOGUE CONVENTIONS .............. 9-3 DISK LOADING/DUMPING ............................ 9-3 Executing DBUG ................................ 9-4 MEMORY COMMANDS Format Control ................................ 9-4 Range ......................................... 9-6 Displaying Memory Contents .................... 9-8 Altering Memory - Decimal or Octal ............ 9-8 Altering Memory - ASCII Format ................ 9-9 REGISTER COMMANDS Displaying All Registers ..................... 9-10 Displaying Individual Registers .............. 9-11 Altering Register Contents ................... 9-12 EXECUTION CONTROL Single Stepping .............................. 9-12 Breakpointing ................................ 9-15 Displaying Breakpoints ....................... 9-16 Clearing Individual Breakpoints .............. 9-17 Clearing All Breakpoints ..................... 9-17 GO Command ................................... 9-18 EXEC ........................................... 9-18 CTRL-A ......................................... 9-18 CTRL-D ......................................... 9-19 COMMAND COMPLETION ............................. 9-19 APPENDIX 9-A Error Messages ............................... 9-20 APPENDIX 9-B DEBUG COMMAND SUMMARY ........................ 9-20 Memory Commands ............................ 9-20 Range ...................................... 9-21 Register Commands .......................... 9-22 Execution Control .......................... 9-22 Program Loading and Dumping ................ 9-22 INDEX .......................................... 9-23 CHAPTER NINE CONSOLE DEBUGGER PAGE 9-2 ============ ================ ======== INTRODUCTION ++++++++++++ The Heath Console Debugger, DBUG, allows you to debug machine language programs from a console terminal. DBUG occupies the lowest 4K of user program RAM (random access memory) location, and can be manipulated via DBUG. Note that your program MUST be ORGed above the end of DBUG. Refer to Appendix 8-A, "Memory Layout - Memory Map" for details. DBUG contains facilities to perform the following nine major functions: * Display the contents of a selected memory location. * Alter the contents of a selected memory location. * Display the contents of any 8080 compatible register. * Alter the contents of any 8080 compatible register. * Execute the user program a single instruction at a time. * Execute the program. * Insert breakpoints and execute the user program. * Load user programs from a device. * Dump user programs to a device. A number of features were designed into DBUG for your convenience. Memory locations and memory and register contents may be displayed as bytes or as words, in octal, decimal, or ASCII format. With these features, you can select the most familiar or desirable format. DBUG also contains a single-instruction facility that permits you to execute your program a single line of instruction at a time. And for more advanced program analysis, a breakpointing feature is included that permits you to execute several instructions in a program and then return control to DBUG for analysis and/or modification. DBUG makes use of the console facilities of HDOS: therefore, the HDOS console control conventions, CTRL-S, CTRL-Q, CTRL-O, CTRL-P, etc, also apply to DBUG. DBUG does not respond to CTRL-Cs. CTRL-A is used to return to DBUG command mode. This is done so the program being debugged can make use of CTRL-B and CTRL-C. When it is accepting commands from the console keyboard, DBUG uses the "command completion" technique. As each character is entered, it is checked against a list of all possible commands. If the character could not be a part of any valid command, DBUG will refuse it by echoing an ASCII BELL character. In addition, if DBUG determines that there is only one choice for the next character in the command, DBUG will type that character for you. Thus, if you strike the L key, DBUG knows that all commands that start with L start with the word LOAD, and will print the entire word, LOAD on the terminal. NOTE: The symbol [^] indicates a space. Spaces are critical in HDOS. *********************************************************************** CHAPTER NINE CONSOLE DEBUGGER PAGE 9-3 ============ ================ ======== COMPUTER/USER DIALOGUE CONVENTIONS ++++++++++++++++++++++++++++++++++ In order to more clearly show the dialogue between the computer and the user, statements made by the computer are set off by quotation marks, and the responses made by the user are set off by apostrophe marks. However, if the statement is an example of a command or similar phrase, showing one or the other of the dialogs, this convention will be ignored, since the meaning will be clear. Anytime you see the symbol [^] it means to make a space unless otherwise indicated. *********************************************************************** DISK LOADING/DUMPING ++++++++++++++++++++ DBUG offers two commands for program loading and dumping (or saving). With these commands, described below, you can load or dump an absolute binary program. LOAD Filename.Ext ----------------- The LOAD command causes the contents of the file specified by <fspec> to be loaded into memory. The file must be in absolute binary format (the format generated by the HDOS assembler). Note that the absolute binary file contains information to tell HDOS where the file must be loaded. DBUG will not allow you to load a program over the DBUG code or over the HDOS operating system. The entry point address for the loaded program will be entered into the program counter (Pc register) automatically. For example: ":B:"'LOAD^SY1:TEST.ABS<RTN>' DUMP^<fspec>^saddr-eadder ------------------------- The DUMP command causes the contents of memory from saddr to and including eadder to be written to the file<fspec> in absolute binary format. The contents of the Pc register at the time of the DUMP are stored in the file as the program's entry point. You can use this feature to save a patched binary program without reassembling it. For example, to save the demo program used on Page 3-13, type: ":B:"'DUMP^TEST^70000-70026<RTN>' *********************************************************************** CHAPTER NINE CONSOLE DEBUGGER PAGE 9-4 ============ ================ ======== EXECUTING DBUG ++++++++++++++ DBUG is called via the HDOS Operating System as follows: ">"'DBUG<RTN>' "HDOS DBUG # 102.00.00" ":B:" Typing a CTRL-D will exit the program. Note that the version number may not be the same as yours, but a number will be shown. *********************************************************************** MEMORY COMMANDS +++++++++++++++ The memory commands permit you to display and alter the contents of indicated memory locations. The format for memory display commands is: <FORMAT CONTROL> <RANGE> <BLANK> The form for the alter memory command is: <FORMAT CONTROL> <RANGE> = <VALUE LIST> [For example: FA^101102-101105^TAP SPACE BAR ONE TIME] Format control specifies that the memory display/alteration is in word or byte format, and whether octal, decimal, or ASCII notation is to be used. The range specifies the memory address or addresses to be displayed or altered, and the command is executed by the typing of a blank using the space bar on the console keyboard. FORMAT CONTROL ============== The format control consists of EITHER zero, one, or two characters which specify the form of the values that are to be displayed and entered. The format control field may take on a number of different forms. They are as follows: CHAPTER NINE CONSOLE DEBUGGER PAGE 9-5 ============ ================ ======== MEMORY COMMANDS (Cont) ++++++++++++++++++++++ FORMAT CONTROL (Cont) ===================== FORMAT CONTROL DESCRIPTION -------------- ----------- Space Space Display/alter as octal integers, byte format. F Display/alter as octal integers, word format. A Display/alter as ASCII characters,