PDP8: Add new breakpoint command based on instruction value (Opcode) (from Dave Gesswein) as discussed in issue #75

This commit is contained in:
Mark Pizzolato 2014-02-07 11:43:52 -08:00
parent 1a7f8d4df0
commit 7ce7317f7c
3 changed files with 14 additions and 5 deletions

View file

@ -353,12 +353,18 @@ while (reason == 0) { /* loop until halted */
} }
MA = IF | PC; /* form PC */ MA = IF | PC; /* form PC */
if (sim_brk_summ && sim_brk_test (MA, SWMASK ('E'))) { /* breakpoint? */ if (sim_brk_summ &&
sim_brk_test (MA, (1u << SIM_BKPT_V_SPC) | SWMASK ('E'))) { /* breakpoint? */
reason = STOP_IBKPT; /* stop simulation */ reason = STOP_IBKPT; /* stop simulation */
break; break;
} }
IR = M[MA]; /* fetch instruction */ IR = M[MA]; /* fetch instruction */
if (sim_brk_summ &&
sim_brk_test (IR, (2u << SIM_BKPT_V_SPC) | SWMASK ('I'))) { /* breakpoint? */
reason = STOP_OPBKPT; /* stop simulation */
break;
}
PC = (PC + 1) & 07777; /* increment PC */ PC = (PC + 1) & 07777; /* increment PC */
int_req = int_req | INT_NO_ION_PENDING; /* clear ION delay */ int_req = int_req | INT_NO_ION_PENDING; /* clear ION delay */
sim_interval = sim_interval - 1; sim_interval = sim_interval - 1;
@ -1364,7 +1370,8 @@ pcq_r = find_reg ("PCQ", NULL, dptr);
if (pcq_r) if (pcq_r)
pcq_r->qptr = 0; pcq_r->qptr = 0;
else return SCPE_IERR; else return SCPE_IERR;
sim_brk_types = sim_brk_dflt = SWMASK ('E'); sim_brk_types = SWMASK ('E') | SWMASK('I');
sim_brk_dflt = SWMASK ('E');
return SCPE_OK; return SCPE_OK;
} }

View file

@ -59,9 +59,10 @@
#define STOP_RSRV 1 /* must be 1 */ #define STOP_RSRV 1 /* must be 1 */
#define STOP_HALT 2 /* HALT */ #define STOP_HALT 2 /* HALT */
#define STOP_IBKPT 3 /* breakpoint */ #define STOP_IBKPT 3 /* breakpoint */
#define STOP_NOTSTD 4 /* non-std devno */ #define STOP_OPBKPT 4 /* Opcode/Instruction breakpoint */
#define STOP_DTOFF 5 /* DECtape off reel */ #define STOP_NOTSTD 5 /* non-std devno */
#define STOP_LOOP 6 /* infinite loop */ #define STOP_DTOFF 6 /* DECtape off reel */
#define STOP_LOOP 7 /* infinite loop */
/* Memory */ /* Memory */

View file

@ -119,6 +119,7 @@ const char *sim_stop_messages[] = {
"Unimplemented instruction", "Unimplemented instruction",
"HALT instruction", "HALT instruction",
"Breakpoint", "Breakpoint",
"Opcode Breakpoint",
"Non-standard device number", "Non-standard device number",
"DECtape off reel", "DECtape off reel",
"Infinite loop" "Infinite loop"