30 |
|
#include "mon_6502.h" |
31 |
|
#include "mon_8080.h" |
32 |
|
|
33 |
+ |
#ifndef VERSION |
34 |
+ |
#define VERSION "2" |
35 |
+ |
#endif |
36 |
+ |
|
37 |
|
|
38 |
|
/* |
39 |
|
* range_args = [expression] [[COMMA] expression] END |
122 |
|
|
123 |
|
void version(void) |
124 |
|
{ |
125 |
< |
fprintf(monout, "mon V%d.%d\n", MON_VERSION_MAJOR, MON_VERSION_MINOR); |
125 |
> |
fprintf(monout, "mon V" VERSION "\n"); |
126 |
|
} |
127 |
|
|
128 |
|
|
264 |
|
} |
265 |
|
|
266 |
|
mon_dot_address = adr; |
267 |
+ |
} |
268 |
+ |
|
269 |
+ |
|
270 |
+ |
/* |
271 |
+ |
* Binary dump |
272 |
+ |
* b [start [end]] |
273 |
+ |
*/ |
274 |
+ |
|
275 |
+ |
void binary_dump(void) |
276 |
+ |
{ |
277 |
+ |
uint32 adr, end_adr; |
278 |
+ |
uint8 str[9]; |
279 |
+ |
|
280 |
+ |
str[8] = 0; |
281 |
+ |
|
282 |
+ |
if (!range_args(&adr, &end_adr, 7)) // 8 lines unless end address specified |
283 |
+ |
return; |
284 |
+ |
|
285 |
+ |
while (adr <= end_adr && !mon_aborted()) { |
286 |
+ |
fprintf(monout, "%08x:", mon_use_real_mem ? adr : adr % mon_mem_size); |
287 |
+ |
uint8 b = mon_read_byte(adr); |
288 |
+ |
for (int m=0x80, i=0; i<8; m>>=1, i++) |
289 |
+ |
str[i] = (b & m) ? '*' : '.'; |
290 |
+ |
fprintf(monout, " '%s'\n", str); |
291 |
+ |
adr++; |
292 |
+ |
} |
293 |
+ |
|
294 |
+ |
mon_dot_address = adr; |
295 |
|
} |
296 |
|
|
297 |
|
|