From: Hugo Villeneuve Date: Sun, 26 Jan 2014 22:50:52 +0000 (-0500) Subject: Allow EM command to be specified without arguments X-Git-Tag: v2.0.1~34 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=fc904031c818c70b4e8e97ac64d79b628c72dbfa;p=emu8051.git Allow EM command to be specified without arguments In this case, program will run from the current PC address until a breakpoint is reached. --- diff --git a/src/cli/emuconsole.c b/src/cli/emuconsole.c index 1c88935..a68acb5 100644 --- a/src/cli/emuconsole.c +++ b/src/cli/emuconsole.c @@ -260,7 +260,7 @@ console_main(void) " Dump Internal Data Memory... DI [address] [size]", " Dump Program Memory......... DP [address] [size]", " Display Registers content... DR", - " Execute..................... EM [address" + " Execute (Run)............... EM [address" " [number of instructions]]", " Help........................ H or ?", " Modify External Data Memory. ME address value", @@ -268,7 +268,7 @@ console_main(void) " Modify Program Memory....... MP address value", " Modify Register............. MR register value", " Quit Emulator............... Q", - " Trace mode.................. T [address]", + " Trace mode (step)........... T [address]", " Unassemble.................. U [address]" " [number of instructions]", " Reset processor............. Z", 0 }; @@ -277,7 +277,7 @@ console_main(void) if (options.stop_address != 0) { /* Automatically run program and stop at specified address. */ - console_exec("0000", NULL); + console_exec("PC", NULL); console_show_registers(); QuitRequest = 1; } else { @@ -390,7 +390,17 @@ console_main(void) goto syntax_error; break; case 'E': - if (STREQ(Command, "EM")) + if (STREQ(Command, "EM") && + (strlen(Parameter1) == 0) && + (strlen(Parameter2) == 0)) + console_exec("PC", NULL); + else if (STREQ(Command, "EM") && + (strlen(Parameter1) != 0) && + (strlen(Parameter2) == 0)) + console_exec(Parameter1, NULL); + else if (STREQ(Command, "EM") && + (strlen(Parameter1) != 0) && + (strlen(Parameter2) != 0)) console_exec(Parameter1, Parameter2); else goto syntax_error;