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.5 by cebix, 2000-04-24T13:10:17Z

# 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"
30 #include "version.h"
32  
33  
34   /*
# Line 117 | Line 118 | static inline uint8 char2print(uint8 c)
118  
119   void version(void)
120   {
121 <        fprintf(monout, "mon V%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
121 >        fprintf(monout, "mon V" VERSION "\n");
122   }
123  
124  
# Line 259 | Line 260 | void ascii_dump(void)
260          }
261  
262          mon_dot_address = adr;
263 + }
264 +
265 +
266 + /*
267 + *  Binary dump
268 + *  b [start [end]]
269 + */
270 +
271 + void binary_dump(void)
272 + {
273 +        uint32 adr, end_adr;
274 +        uint8 str[9];
275 +
276 +        str[8] = 0;
277 +
278 +        if (!range_args(&adr, &end_adr, 7))  // 8 lines unless end address specified
279 +                return;
280 +
281 +        while (adr <= end_adr && !mon_aborted()) {
282 +                fprintf(monout, "%08x:", mon_use_real_mem ? adr : adr % mon_mem_size);
283 +                uint8 b = mon_read_byte(adr);
284 +                for (int m=0x80, i=0; i<8; m>>=1, i++)
285 +                        str[i] = (b & m) ? '*' : '.';
286 +                fprintf(monout, " '%s'\n", str);
287 +                adr++;
288 +        }
289 +
290 +        mon_dot_address = adr;
291   }
292  
293  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines