--- mon/README 2000/10/15 15:07:09 1.8 +++ mon/README 2000/10/18 00:50:00 1.9 @@ -391,6 +391,31 @@ Load a BeBox boot ROM image and start di d 100 +Using cxmon in your own programs +-------------------------------- + +cxmon provides a simple interface for integration in other programs. It can, +for example, be used as a monitor/debugger for an emulator (it is used in +Basilisk II in this way). + +Here's how to do it (all functions are defined in the mon.h header file): + + 1. Link all the cxmon object files, except main.o, to your program. + 2. In your program, call mon_init() before using any other cxmon functions. + 3. After calling mon_init(), set the mon_read_byte and mon_write_byte + function pointers to the routines used for accessing memory. + 4. You can use mon_add_command() to add new commands to cxmon by specifying + the command name, function and help text. From within your command + function, you can use mon_get_token() and mon_expression() to parse the + arguments and the mon_read/write_*() functions to access memory. + 5. To enter cxmon, call the mon() function like this: + + char *args[3] = {"mon", "-r", NULL}; + mon(2, args); + + 6. If you're done with cxmon, call mon_exit(). + + History -------