1 |
|
/* |
2 |
< |
* mon.h - mon main program |
2 |
> |
* mon.h - cxmon main program |
3 |
|
* |
4 |
< |
* mon (C) 1997-2000 Christian Bauer, Marc Hellwig |
4 |
> |
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
28 |
|
* Initialization, deinitialization and invocation |
29 |
|
*/ |
30 |
|
|
31 |
< |
void mon_init(void); |
32 |
< |
void mon_exit(void); |
31 |
> |
void mon_init(); |
32 |
> |
void mon_exit(); |
33 |
|
void mon(int argc, char **argv); |
34 |
|
|
35 |
|
|
37 |
|
* Definitions for adding commands to mon |
38 |
|
*/ |
39 |
|
|
40 |
– |
// Maximum input length |
41 |
– |
const int INPUT_LENGTH = 256; |
42 |
– |
|
40 |
|
// Input tokens |
41 |
|
enum Token { |
42 |
|
T_NULL, // Invalid token |
64 |
|
}; |
65 |
|
|
66 |
|
// Scanner variables |
67 |
< |
extern enum Token mon_token; // Last token read |
68 |
< |
extern uint32 mon_number; // Contains the number if mon_token==T_NUMBER |
69 |
< |
extern char mon_string[INPUT_LENGTH]; // Contains the string if mon_token==T_STRING |
70 |
< |
extern char mon_name[INPUT_LENGTH]; // Contains the variable name if mon_token==T_NAME |
67 |
> |
extern enum Token mon_token; // Last token read |
68 |
> |
extern uintptr mon_number; // Contains the number if mon_token==T_NUMBER |
69 |
> |
extern char *mon_string; // Contains the string if mon_token==T_STRING |
70 |
> |
extern char *mon_name; // Contains the variable name if mon_token==T_NAME |
71 |
|
|
72 |
|
// Streams for input, output and error messages |
73 |
|
extern FILE *monin, *monout, *monerr; |
74 |
|
|
75 |
|
// Current address, value of '.' in expressions |
76 |
< |
extern uint32 mon_dot_address; |
76 |
> |
extern uintptr mon_dot_address; |
77 |
|
|
78 |
< |
extern bool mon_use_real_mem; // Flag: mon is using real memory |
79 |
< |
extern uint32 mon_mem_size; // Size of mon buffer (if mon_use_real_mem = false) |
78 |
> |
extern bool mon_use_real_mem; // Flag: mon is using real memory |
79 |
> |
extern uint32 mon_mem_size; // Size of mon buffer (if mon_use_real_mem = false) |
80 |
|
|
81 |
< |
extern bool mon_macos_mode; // Flag: enable features in the disassembler for working with MacOS code |
81 |
> |
extern bool mon_macos_mode; // Flag: enable features in the disassembler for working with MacOS code |
82 |
|
|
83 |
|
// Add command to mon |
84 |
< |
extern void mon_add_command(const char *name, void (*func)(void), const char *help_text); |
84 |
> |
extern void mon_add_command(const char *name, void (*func)(), const char *help_text); |
85 |
|
|
86 |
|
// Functions for commands |
87 |
< |
extern void mon_error(const char *s); // Print error message |
88 |
< |
extern enum Token mon_get_token(void); // Get next token |
89 |
< |
extern bool mon_expression(uint32 *number); // Parse expression |
90 |
< |
extern bool mon_aborted(void); // Check if Ctrl-C was pressed |
87 |
> |
extern void mon_error(const char *s); // Print error message |
88 |
> |
extern enum Token mon_get_token(); // Get next token |
89 |
> |
extern bool mon_expression(uintptr *number); // Parse expression |
90 |
> |
extern bool mon_aborted(); // Check if Ctrl-C was pressed |
91 |
|
|
92 |
|
// Memory access |
93 |
< |
extern uint32 (*mon_read_byte)(uint32 adr); |
94 |
< |
extern void (*mon_write_byte)(uint32 adr, uint32 b); |
95 |
< |
extern uint32 mon_read_half(uint32 adr); |
96 |
< |
extern void mon_write_half(uint32 adr, uint32 w); |
97 |
< |
extern uint32 mon_read_word(uint32 adr); |
98 |
< |
extern void mon_write_word(uint32 adr, uint32 l); |
93 |
> |
extern uint32 (*mon_read_byte)(uintptr adr); |
94 |
> |
extern void (*mon_write_byte)(uintptr adr, uint32 b); |
95 |
> |
extern uint32 mon_read_half(uintptr adr); |
96 |
> |
extern void mon_write_half(uintptr adr, uint32 w); |
97 |
> |
extern uint32 mon_read_word(uintptr adr); |
98 |
> |
extern void mon_write_word(uintptr adr, uint32 l); |
99 |
|
|
100 |
|
#endif |