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.10 by cebix, 2002-01-18T16:03:33Z vs.
Revision 1.11 by gbeauche, 2002-07-17T10:00:54Z

# Line 40 | Line 40
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;
# Line 67 | Line 67 | static bool range_args(uint32 *adr, uint
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;
# Line 161 | Line 161 | void redir_output(void)
161  
162   void print_expr(void)
163   {
164 <        uint32 val;
164 >        uintptr val;
165  
166          if (!mon_expression(&val))
167                  return;
# Line 213 | Line 213 | void shell_command(void)
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;
# Line 222 | Line 222 | void memory_dump(void)
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));
# Line 244 | Line 244 | void memory_dump(void)
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;
# Line 270 | Line 270 | void ascii_dump(void)
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;
# Line 312 | Line 312 | enum CPUType {
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;
# Line 407 | Line 407 | void disassemble_80x86_16(void)
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))
# Line 429 | Line 429 | void modify(void)
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))
# Line 451 | Line 451 | void fill(void)
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))
# Line 485 | Line 485 | void transfer(void)
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))
# Line 522 | Line 522 | void compare(void)
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  
# Line 564 | Line 564 | void hunt(void)
564  
565   void load_data(void)
566   {
567 <        uint32 start_adr;
567 >        uintptr start_adr;
568          FILE *file;
569          int fc;
570  
# Line 587 | Line 587 | void load_data(void)
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);
# Line 606 | Line 606 | void load_data(void)
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))
# Line 630 | Line 630 | void save_data(void)
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines