40 |
|
* true: OK, false: Error |
41 |
|
*/ |
42 |
|
|
43 |
< |
static bool range_args(uint32 *adr, uint32 *end_adr, uint32 def_range) |
43 |
> |
static bool range_args(uintptr *adr, uintptr *end_adr, uint32 def_range) |
44 |
|
{ |
45 |
|
*adr = mon_dot_address; |
46 |
|
*end_adr = mon_dot_address + def_range; |
67 |
|
* byte_string = (expression | STRING) {COMMA (expression | STRING)} END |
68 |
|
*/ |
69 |
|
|
70 |
< |
static bool byte_string(uint8 *s, uint32 &len) |
70 |
> |
static bool byte_string(uint8 *s, uintptr &len) |
71 |
|
{ |
72 |
< |
uint32 value; |
72 |
> |
uintptr value; |
73 |
|
|
74 |
|
len = 0; |
75 |
|
goto start; |
161 |
|
|
162 |
|
void print_expr(void) |
163 |
|
{ |
164 |
< |
uint32 val; |
164 |
> |
uintptr val; |
165 |
|
|
166 |
|
if (!mon_expression(&val)) |
167 |
|
return; |
213 |
|
|
214 |
|
void memory_dump(void) |
215 |
|
{ |
216 |
< |
uint32 adr, end_adr; |
216 |
> |
uintptr adr, end_adr; |
217 |
|
uint8 mem[MEMDUMP_BPL + 1]; |
218 |
|
|
219 |
|
mem[MEMDUMP_BPL] = 0; |
222 |
|
return; |
223 |
|
|
224 |
|
while (adr <= end_adr && !mon_aborted()) { |
225 |
< |
fprintf(monout, "%08x:", mon_use_real_mem ? adr: adr % mon_mem_size); |
225 |
> |
fprintf(monout, "%0*lx:", 2 * sizeof(adr), mon_use_real_mem ? adr: adr % mon_mem_size); |
226 |
|
for (int i=0; i<MEMDUMP_BPL; i++, adr++) { |
227 |
|
if (i % 4 == 0) |
228 |
|
fprintf(monout, " %08x", mon_read_word(adr)); |
244 |
|
|
245 |
|
void ascii_dump(void) |
246 |
|
{ |
247 |
< |
uint32 adr, end_adr; |
247 |
> |
uintptr adr, end_adr; |
248 |
|
uint8 str[ASCIIDUMP_BPL + 1]; |
249 |
|
|
250 |
|
str[ASCIIDUMP_BPL] = 0; |
270 |
|
|
271 |
|
void binary_dump(void) |
272 |
|
{ |
273 |
< |
uint32 adr, end_adr; |
273 |
> |
uintptr adr, end_adr; |
274 |
|
uint8 str[9]; |
275 |
|
|
276 |
|
str[8] = 0; |
312 |
|
|
313 |
|
static void disassemble(CPUType type) |
314 |
|
{ |
315 |
< |
uint32 adr, end_adr; |
315 |
> |
uintptr adr, end_adr; |
316 |
|
|
317 |
|
if (!range_args(&adr, &end_adr, 16 * 4 - 1)) // 16 lines unless end address specified |
318 |
|
return; |
407 |
|
|
408 |
|
void modify(void) |
409 |
|
{ |
410 |
< |
uint32 adr, len, src_adr = 0; |
410 |
> |
uintptr adr, len, src_adr = 0; |
411 |
|
uint8 str[256]; |
412 |
|
|
413 |
|
if (!mon_expression(&adr)) |
429 |
|
|
430 |
|
void fill(void) |
431 |
|
{ |
432 |
< |
uint32 adr, end_adr, len, src_adr = 0; |
432 |
> |
uintptr adr, end_adr, len, src_adr = 0; |
433 |
|
uint8 str[256]; |
434 |
|
|
435 |
|
if (!mon_expression(&adr)) |
451 |
|
|
452 |
|
void transfer(void) |
453 |
|
{ |
454 |
< |
uint32 adr, end_adr, dest; |
454 |
> |
uintptr adr, end_adr, dest; |
455 |
|
int num; |
456 |
|
|
457 |
|
if (!mon_expression(&adr)) |
485 |
|
|
486 |
|
void compare(void) |
487 |
|
{ |
488 |
< |
uint32 adr, end_adr, dest; |
488 |
> |
uintptr adr, end_adr, dest; |
489 |
|
int num = 0; |
490 |
|
|
491 |
|
if (!mon_expression(&adr)) |
522 |
|
|
523 |
|
void hunt(void) |
524 |
|
{ |
525 |
< |
uint32 adr, end_adr, len; |
525 |
> |
uintptr adr, end_adr, len; |
526 |
|
uint8 str[256]; |
527 |
|
int num = 0; |
528 |
|
|
564 |
|
|
565 |
|
void load_data(void) |
566 |
|
{ |
567 |
< |
uint32 start_adr; |
567 |
> |
uintptr start_adr; |
568 |
|
FILE *file; |
569 |
|
int fc; |
570 |
|
|
587 |
|
if (!(file = fopen(mon_string, "rb"))) |
588 |
|
mon_error("Unable to open file"); |
589 |
|
else { |
590 |
< |
uint32 adr = start_adr; |
590 |
> |
uintptr adr = start_adr; |
591 |
|
|
592 |
|
while ((fc = fgetc(file)) != EOF) |
593 |
|
mon_write_byte(adr++, fc); |
606 |
|
|
607 |
|
void save_data(void) |
608 |
|
{ |
609 |
< |
uint32 start_adr, size; |
609 |
> |
uintptr start_adr, size; |
610 |
|
FILE *file; |
611 |
|
|
612 |
|
if (!mon_expression(&start_adr)) |
630 |
|
if (!(file = fopen(mon_string, "wb"))) |
631 |
|
mon_error("Unable to create file"); |
632 |
|
else { |
633 |
< |
uint32 adr = start_adr, end_adr = start_adr + size - 1; |
633 |
> |
uintptr adr = start_adr, end_adr = start_adr + size - 1; |
634 |
|
|
635 |
|
while (adr <= end_adr) |
636 |
|
fputc(mon_read_byte(adr++), file); |