HEXPERT USER'S MANUAL Advanced Software Systems 55 Grenon O. Street Laval Des Rapides, Quebec H7N 5M3 Canada Hexpert and Hexpert's manual are (c) copyright Advanced Software Systems, 1990. Commodore 64 is a registered trademark of Commodore Electronics Ltd. Commodore 128 is a registered trademark of Commodore Electronics Ltd. geoDebugger is a registered trademark of Berkeley Softworks TurboDebugger is a registered trademark of Borland International Manual written by Eric Trepanier (release 1.0) Hexpert designed and written by Eric Trepanier A Few Words from the Author As an active Commodore 128 programmer, I have every intentions of improving Hexpert and make it more and more versatile and powerful. This software is released as Public Domain, which means I am granting you the privilege of using it at your discretion. I am not expecting any financial compensation out of this program. You can freely distribute it, and what the hell, you can even sell it if you can find someone silly enough to pay anything for it. This is not to say that Hexpert is not a good program. In fact, I am not sure they are other debuggers available for the C128, besides geoDebugger. The only thing I expect from the programmers who will actually use it is some feedback, either good or bad. I want this program to be the "BEST" debugger for the C128. This is only an initial release, but future versions will include much more advanced features. However, if I don't get any feedbacks, I'll have to conclude that it's not worth spending time on it. Any suggestions, criticism, or simply a wish-me-luck card will be appreciated... Eric Trepanier NOTE: If you do distribute this program, please distribute it in its entirety, with all the documentation files. Needless to say that a modified copy of Hexpert should not be distributed. Credits This program might never have seen the light of day without the presence of a good friend of mine named Pedro, who happens to be an excellent machine language programmer himself. Without his help, I would never have mastered machine language so easily. I would also like to thank a couple of my friends for their encouragements and support. These friends are Sylvain Tremblay, Philippe Blais and Marc Veilleux. Disclaimer Let's get this over with... This program and accompanying documentation come with no warranty, either express or implied, with respect to accuracy or suitability for any particular application. The author assumes no responsability whatsoever for any damage, direct or incidental, resulting from their use. Good, now on to the more interesting stuff! Table of Contents Chapter 1 Introduction to Hexpert What is Hexpert? 6 Manual Organisation 6 The Origin of Hexpert 7 Chapter 2 Hexpert Usage What is a Debugger? 8 Hexpert Features 8 Dual Displays 9 Breakpoints 9 Running Hexpert 9 Sample Hexpert Session 10 Chapter 3 Hexpert Reference Command Syntax 13 The Concept of Memory Banking on the Commodore 128 14 Hexpert Command Summary 15 General Commands 16 Display Commands 18 Execution Commands 21 Breakpoint Commands 25 How Breakpoints work: The Ins and Outs of Breakpoints 25 Appendices Appendix A Information Messages 27 Error Messages 27 Appendix B Debugger Dependency 29 Off Limits Memory 29 Miscellaneous 29 Appendix C Commodore 128 and the 8502 Machine Language 30 Chapter 1: Introduction to Hexpert What is Hexpert? Hexpert is a simple program, designed to be used in conjunction with the C128's built-in machine language monitor. This is part of the reason why even though it is relatively small (2K), it still has a lot of features to offer. Hexpert makes as much use as possible of the monitor's own routines (e.g. symbolic disassembly, numeric conversions, etc.). The main purpose of Hexpert is to allow you to monitor your programs as they are executed. This is what a debugger is for. Several commands are available to allow a close watch of the program's state at any time during its execution. Manual Organisation This manual is organised in the following manner: Chapter 1 is the introduction chapter. This chapter needs only to be read if you wish to know more about the development of Hexpert. It is not essential for making good use of Hexpert. Chapter 2 presents a brief discussion on the concept of "program debugging". It presents some of the major features of Hexpert. At the end of the chapter, there is a complete "hands-on" sample session to illustrate these functions. Although not essential, this chapter will make a good introduction on how to actually use Hexpert. It would be a good idea to read it through before using the debugger. Chapter 3 is the reference chapter. This is the most important chapter, it presents all the debugger's commands as well as examples on how to use each of them. Appendix A explains all the debugger's information and error messages, appendix B contains all the technical information concerning Hexpert and appendix C presents a small C128 machine language bibliography. The Origin of Hexpert Recently, I started working on a window package, with commands for opening, closing, moving and resizing windows. I quickly realized I could hardly debug the subroutines without the help of something more evolved than the C128's monitor. This is how I got the idea for Hexpert. At first, I didn' t think of releasing it in the Public Domain. I was doing this program for my personnal needs, end of the line. A friend of mine who saw an early version of Hexpert running was impressed. He suggested that I add some features and release it as a shareware program. So I did add a few options here and there, and made it what it is now. However, I felt kind of shamed to release it as shareware. There are so many good PD programs out there. I just felt I owed it to them to release my own program as Public Domain. Besides, it didn't take me more than a few weeks to finish the program. Some shareware programs take years to create (e.g. DesTerm 128 v2.00 from Matthew E. Desmond) and yet their authors only charge a ridiculously small fee for their use. It's up to you, the users, to turn Hexpert into a real bug killer. Just send in your comments on Hexpert. Let me know if you discover any "undocumented features". Every suggestions will be considered. If I see that it is used, I might rework it over and turn into a serious TurboDebugger competitor. Chapter 2: Hexpert Usage This chapter introduces the major features of Hexpert as well as overviewing how to run and use the debugger. It begins by describing the concept of debugging and finishes with a short tutorial covering the basic features of Hexpert. This chapter does not cover aspects of the debugger in exhaustive detail. Refer to the following chapter for more complete coverage. What Is A Debugger? Unless you are an exceptional programmer, your programs will seldom work right away. Most of the time, they will be "bugged". Bugs are the little mistakes and errors that you haven't noticed while coding your program. It might be an incorrect jump or a bad branch, or it could be something much less obvious. In such cases, it's very hard to know exactly what is going wrong. Maybe your algorithm has a logical error, but unless you can trace your program step by step and monitor all important variables, you will have a very hard time fixing the problem. This is where a debugger comes in handy. With it, you can set up breakpoints in your program and then execute it. When your program reaches the breakpoints, it will stop and you can monitor all the 8502 registers and important variables. You can also watch your program's execution instruction by instruction. The debugger is perhaps the programmer's most important tool. Hexpert Features Hexpert is a software debugger that is accessed via the C128's monitor. A lot of work has been put to make Hexpert as small as possible, yet big enough to hold a complete arsenal of useful debugging commands. The result is a surprisingly versatile 2K debugger with all the important features one could expect from an expensive commercial debugger package. Hexpert offers a plethora of commands to help you monitor your program and memory, giving you full access to both C128's RAM bank, I/O registers, Kernal ROM and all 8502 registers. You can disassemble, modify and run your program interactively, setting break points, displaying and changing register values. Dual Displays Hexpert makes use of both the C128's forty and eighty column display. This allows you to debug on the forty column screen a program which accesses the eighty column screen, so the program's output will not be disturbed by Hexpert's output. This feature works best if you have access to two monitors (CRTs). Hexpert could be run on one monitor while the program's output appears on the other monitor. Even geoDebugger doesn't allow this possibility! The screens may be swapped at anytime during the program's execution. Breakpoints Hexpert supports a user-breakpoint facility in a limited fashion. Breakpoints may be set anywhere in RAM memory. Once a breakpoint is encountered during program execution, the program stops and Hexpert is given control. Due to memory conflicts, this version of Hexpert doesn't allow the use of a single break point more than once. This means that once a breakpoint has been reached, it is removed from the program. Hexpert allows ten simultaneous break points. Running Hexpert There are many ways to activate Hexpert. If your assembler/linker doesn't alter memory in the range $...
Amiga7878