--- mon/README 2000/10/15 15:07:09 1.8 +++ mon/README 2003/09/27 20:22:55 1.12 @@ -1,8 +1,8 @@ - cxmon, Version 3.0 + cxmon, Version 3.1 A command-line file manipulation tool and disassembler - Copyright (C) 1997-2000 Christian Bauer, Marc Hellwig + Copyright (C) 1997-2003 Christian Bauer, Marc Hellwig GNU binutils disassemblers Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. @@ -18,11 +18,12 @@ Overview -------- cxmon is an interactive command-driven file manipulation tool that is -inspired by the "Amiga Monitor" by Timo Rossi . It has -commands and features similar to a machine code monitor/debugger, but it -lacks any functions for running/tracing code. There are, however, built-in -PowerPC, 680x0, 80x86, 6502 and Z80 disassemblers. By default, cxmon operates -on a fixed-size (but adjustable) memory buffer with adresses starting at 0. +inspired by the "Amiga Monitor" by Timo Rossi. It has commands and features +similar to a machine code monitor/debugger, but it lacks any functions for +running/tracing code. There are, however, built-in PowerPC, 680x0, 80x86, +x86-64, 6502 and Z80 disassemblers and special support for disassembling +MacOS code. By default, cxmon operates on a fixed-size (but adjustable) +memory buffer with adresses starting at 0. Installation @@ -233,6 +234,13 @@ Entering "d8086" without arguments is eq of "." is set to the address after the last address displayed. + d8664 [start [end]] Disassemble x86-64 code + +disassembles the buffer contents from address "start" to address "end". +Entering "d8086" without arguments is equivalent to "d8086 .". The value +of "." is set to the address after the last address displayed. + + : start string Modify memory puts the specified byte string at the address "start" into the buffer. The @@ -391,6 +399,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 -------