PDP11: Add SP to instruction history

This commit is contained in:
Bob Supnik 2019-04-15 22:01:08 -07:00 committed by Mark Pizzolato
parent d8eeb1ce00
commit cdfb7c0878

View file

@ -258,6 +258,8 @@ typedef struct {
uint16 psw; uint16 psw;
uint16 src; uint16 src;
uint16 dst; uint16 dst;
uint16 sp;
uint16 pad;
uint16 inst[HIST_ILNT]; uint16 inst[HIST_ILNT];
} InstHistory; } InstHistory;
@ -963,6 +965,7 @@ while (reason == 0) {
}; };
hst_ent = &hst[hst_p]; hst_ent = &hst[hst_p];
hst_ent->pc = PC | HIST_VLD; hst_ent->pc = PC | HIST_VLD;
hst_ent->sp = SP;
hst_ent->psw = get_PSW (); hst_ent->psw = get_PSW ();
hst_ent->src = 0; hst_ent->src = 0;
hst_ent->dst = 0; hst_ent->dst = 0;
@ -3551,12 +3554,12 @@ else lnt = hst_lnt;
di = hst_p - lnt; /* work forward */ di = hst_p - lnt; /* work forward */
if (di < 0) if (di < 0)
di = di + hst_lnt; di = di + hst_lnt;
fprintf (st, "PC PSW src dst IR\n\n"); fprintf (st, "PC SP PSW src dst IR\n\n");
for (k = 0; k < lnt; k++) { /* print specified */ for (k = 0; k < lnt; k++) { /* print specified */
h = &hst[(di++) % hst_lnt]; /* entry pointer */ h = &hst[(di++) % hst_lnt]; /* entry pointer */
if (h->pc & HIST_VLD) { /* instruction? */ if (h->pc & HIST_VLD) { /* instruction? */
ir = h->inst[0]; ir = h->inst[0];
fprintf (st, "%06o %06o|", h->pc & ~HIST_VLD, h->psw); fprintf (st, "%06o %06o %06o|", h->pc & ~HIST_VLD, h->psw);
if (((ir & 0070000) != 0) || /* dops, eis, fpp */ if (((ir & 0070000) != 0) || /* dops, eis, fpp */
((ir & 0177000) == 0004000)) /* jsr */ ((ir & 0177000) == 0004000)) /* jsr */
fprintf (st, "%06o %06o ", h->src, h->dst); fprintf (st, "%06o %06o ", h->src, h->dst);