X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Femuconsole.c;h=b8c3bc388a2478c6c9214208ecedb2d13367bc81;hb=60f3340a9f321271f5ea96df2ccfc248f67bfd2f;hp=e31d1b3cee6de19fb3b944d939e45a5a9ac9bdfd;hpb=b23541495010180e3a69e3e1f64c934b28775878;p=emu8051.git diff --git a/src/emuconsole.c b/src/emuconsole.c index e31d1b3..b8c3bc3 100644 --- a/src/emuconsole.c +++ b/src/emuconsole.c @@ -224,9 +224,9 @@ console_main(void) " Set Breakpoint.............. SB [address]", " Remove Breakpoint........... RB [address]", " Display Breakpoint(s)....... DB", - " Dump External Data Memory... DE [address]", - " Dump Internal Data Memory... DI [address]", - " Dump Program Memory......... DP [address]", + " Dump External Data Memory... DE [address] [size]", + " Dump Internal Data Memory... DI [address] [size]", + " Dump Program Memory......... DP [address] [size]", " Display Registers content... DR", " Execute..................... EM [address" " [number of instructions]]", @@ -325,29 +325,21 @@ console_main(void) switch (Command[0]) { case 'D': - if (strlen(Parameter2) == 0) { - char buf[1024]; - - if (STREQ(Command, "DB") && - (strlen(Parameter1) == 0)) - ShowBreakpoints(); - else if (STREQ(Command, "DE")) { - DumpMem(buf, Parameter1, EXT_MEM_ID); - printf(buf); - } else if (STREQ(Command, "DI")) { - DumpMem(buf, Parameter1, INT_MEM_ID); - printf(buf); - } else if (STREQ(Command, "DP")) { - if ((strlen(Parameter1) == 0)) - strcpy(Parameter1, "PC"); - DumpMem(buf, Parameter1, PGM_MEM_ID); - printf(buf); - } else if (STREQ(Command, "DR") && - (strlen(Parameter1) == 0)) - console_show_registers(); - else - goto syntax_error; - } else + if (STREQ(Command, "DB") && + (strlen(Parameter1) == 0)) + ShowBreakpoints(); + else if (STREQ(Command, "DE")) + DumpMem(Parameter1, Parameter2, EXT_MEM_ID); + else if (STREQ(Command, "DI")) + DumpMem(Parameter1, Parameter2, INT_MEM_ID); + else if (STREQ(Command, "DP")) { + if ((strlen(Parameter1) == 0)) + strcpy(Parameter1, "PC"); + DumpMem(Parameter1, Parameter2, PGM_MEM_ID); + } else if (STREQ(Command, "DR") && + (strlen(Parameter1) == 0)) + console_show_registers(); + else goto syntax_error; break; case 'E': @@ -473,7 +465,10 @@ main(int argc, char **argv) LoadHexFile(hex_file); console_main(); + +#ifdef EMU8051_DEBUG printf("End of program.\n"); +#endif return 0; }