static void
Capitalize(char *buffer)
{
- int k;
+ size_t k;
for (k = 0; k < strlen(buffer); k++)
buffer[k] = toupper(buffer[k]);
static void
RemoveSpaces(char *buffer)
{
- int k = 0;
+ size_t k = 0;
while ((k < strlen(buffer)) && isblank(buffer[k]))
k++;
log_info("Program executing...");
- do {
- cpu8051_Exec();
- if (NbInst > 0)
- NbInst--;
- } while (!IsBreakpoint(cpu8051.pc) && !IsStoppoint(cpu8051.pc) &&
- (NbInst != 0) && !kbhit());
+ cpu8051_run(NbInst, kbhit);
+
if (kbhit()) {
(void) getch(); /* Flush key */
log_info("Caught break signal!");
}
- if (NbInst == 0)
- log_info("Number of instructions reached! Stopping!");
- if (IsBreakpoint(cpu8051.pc))
- log_info("Breakpoint hit at %.4X! Stopping!", cpu8051.pc);
- if (IsStoppoint(cpu8051.pc))
- log_info("Stoppoint hit at %.4X! Stopping!", cpu8051.pc);
ResetUnixKB();
}
while (!QuitRequest) {
int slen;
size_t len = 0;
+ int rc;
char Command[256];
char Args[256];
char Parameter1[256];
Parameter2[0] = '\0';
printf("%s", prompt);
- (void) getline(&line, &len, stdin);
+ rc = getline(&line, &len, stdin);
+ if (rc < 0)
+ goto syntax_error;
+
Capitalize(line);
RemoveSpaces(line);