ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/mon/src/mon_cmd.cpp
(Generate patch)

Comparing mon/src/mon_cmd.cpp (file contents):
Revision 1.3 by cebix, 1999-10-05T14:43:46Z vs.
Revision 1.6 by hellwig, 2000-06-10T19:07:37Z

# Line 20 | Line 20
20  
21   #include "sysdeps.h"
22  
23 + #include <stdlib.h>
24 +
25   #include "mon.h"
26   #include "mon_cmd.h"
27   #include "mon_ppc.h"
# Line 27 | Line 29
29   #include "mon_x86.h"
30   #include "mon_6502.h"
31   #include "mon_8080.h"
32 < #include "version.h"
32 >
33 > #ifndef VERSION
34 > #define VERSION "2"
35 > #endif
36  
37  
38   /*
# Line 117 | Line 122 | static inline uint8 char2print(uint8 c)
122  
123   void version(void)
124   {
125 <        fprintf(monout, "mon V%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
125 >        fprintf(monout, "mon V" VERSION "\n");
126   }
127  
128  
# Line 259 | Line 264 | void ascii_dump(void)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines