2 |
|
cxmon, Version 3.0 |
3 |
|
A command-line file manipulation tool and disassembler |
4 |
|
|
5 |
< |
Copyright (C) 1997-2000 Christian Bauer, Marc Hellwig |
5 |
> |
Copyright (C) 1997-2002 Christian Bauer, Marc Hellwig |
6 |
|
GNU binutils disassemblers Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 97, 1998 |
7 |
|
Free Software Foundation, Inc. |
8 |
|
|
18 |
|
-------- |
19 |
|
|
20 |
|
cxmon is an interactive command-driven file manipulation tool that is |
21 |
< |
inspired by the "Amiga Monitor" by Timo Rossi <trossi@jyu.fi>. It has |
22 |
< |
commands and features similar to a machine code monitor/debugger, but it |
23 |
< |
lacks any functions for running/tracing code. There are, however, built-in |
24 |
< |
PowerPC, 680x0, 80x86, 6502 and Z80 disassemblers. By default, cxmon operates |
25 |
< |
on a fixed-size (but adjustable) memory buffer with adresses starting at 0. |
21 |
> |
inspired by the "Amiga Monitor" by Timo Rossi. It has commands and features |
22 |
> |
similar to a machine code monitor/debugger, but it lacks any functions for |
23 |
> |
running/tracing code. There are, however, built-in PowerPC, 680x0, 80x86, |
24 |
> |
6502 and Z80 disassemblers and special support for disassembling MacOS code. |
25 |
> |
By default, cxmon operates on a fixed-size (but adjustable) memory buffer |
26 |
> |
with adresses starting at 0. |
27 |
|
|
28 |
|
|
29 |
|
Installation |
392 |
|
d 100 |
393 |
|
|
394 |
|
|
395 |
+ |
Using cxmon in your own programs |
396 |
+ |
-------------------------------- |
397 |
+ |
|
398 |
+ |
cxmon provides a simple interface for integration in other programs. It can, |
399 |
+ |
for example, be used as a monitor/debugger for an emulator (it is used in |
400 |
+ |
Basilisk II in this way). |
401 |
+ |
|
402 |
+ |
Here's how to do it (all functions are defined in the mon.h header file): |
403 |
+ |
|
404 |
+ |
1. Link all the cxmon object files, except main.o, to your program. |
405 |
+ |
2. In your program, call mon_init() before using any other cxmon functions. |
406 |
+ |
3. After calling mon_init(), set the mon_read_byte and mon_write_byte |
407 |
+ |
function pointers to the routines used for accessing memory. |
408 |
+ |
4. You can use mon_add_command() to add new commands to cxmon by specifying |
409 |
+ |
the command name, function and help text. From within your command |
410 |
+ |
function, you can use mon_get_token() and mon_expression() to parse the |
411 |
+ |
arguments and the mon_read/write_*() functions to access memory. |
412 |
+ |
5. To enter cxmon, call the mon() function like this: |
413 |
+ |
|
414 |
+ |
char *args[3] = {"mon", "-r", NULL}; |
415 |
+ |
mon(2, args); |
416 |
+ |
|
417 |
+ |
6. If you're done with cxmon, call mon_exit(). |
418 |
+ |
|
419 |
+ |
|
420 |
|
History |
421 |
|
------- |
422 |
|
|