1
0
mirror of https://github.com/simh/simh.git synced 2026-01-26 12:02:14 +00:00

ALL simulators with instruction history support: Minor history enhancements

- Issue reasonable error message explaining invalid SET CPU HISTORY=n input
- Let SIGINT (^C) abort SHOW HISTORY output
This commit is contained in:
Mark Pizzolato
2023-12-04 10:57:31 -10:00
parent 42d6f414fc
commit 6d376b2fd9
29 changed files with 245 additions and 74 deletions

View File

@@ -2373,8 +2373,10 @@ if (cptr == NULL) {
return SCPE_OK;
}
lnt = (int32) get_uint (cptr, 10, HIST_MAX, &r);
if ((r != SCPE_OK) || (lnt && (lnt < HIST_MIN)))
return SCPE_ARG;
if (r != SCPE_OK)
return sim_messagef (SCPE_ARG, "Invalid Numeric Value: %s. Maximum is %d\n", cptr, HIST_MAX);
if (lnt && (lnt < HIST_MIN))
return sim_messagef (SCPE_ARG, "%d is less than the minumum history value of %d\n", lnt, HIST_MIN);
hst_p = 0;
if (hst_lnt) {
free (hst);
@@ -2468,6 +2470,10 @@ if (di < 0)
di = di + hst_lnt;
fprintf (st, " PC repeat AC MQ SI EA IR\n\n");
for (k = 0; k < lnt; k++) { /* print specified */
if (stop_cpu) { /* Control-C (SIGINT) */
stop_cpu = FALSE;
break; /* abandon remaining output */
}
h = &hst[(++di) % hst_lnt]; /* entry pointer */
cpu_fprint_one_inst (st, h->pc, h->rpt, h->ea, h->ir, h->ac, h->mq, h->si, h->opnd);
} /* end for */