--- mon/src/mon_cmd.cpp 1999/10/25 08:04:47 1.4 +++ mon/src/mon_cmd.cpp 2000/04/24 13:10:17 1.5 @@ -118,7 +118,7 @@ static inline uint8 char2print(uint8 c) void version(void) { - fprintf(monout, "mon V%d.%d\n", MON_VERSION_MAJOR, MON_VERSION_MINOR); + fprintf(monout, "mon V" VERSION "\n"); } @@ -260,6 +260,34 @@ void ascii_dump(void) } mon_dot_address = adr; +} + + +/* + * Binary dump + * b [start [end]] + */ + +void binary_dump(void) +{ + uint32 adr, end_adr; + uint8 str[9]; + + str[8] = 0; + + if (!range_args(&adr, &end_adr, 7)) // 8 lines unless end address specified + return; + + while (adr <= end_adr && !mon_aborted()) { + fprintf(monout, "%08x:", mon_use_real_mem ? adr : adr % mon_mem_size); + uint8 b = mon_read_byte(adr); + for (int m=0x80, i=0; i<8; m>>=1, i++) + str[i] = (b & m) ? '*' : '.'; + fprintf(monout, " '%s'\n", str); + adr++; + } + + mon_dot_address = adr; }