diff --git a/SDS/sds_cpu.c b/SDS/sds_cpu.c index 70dc2429..9fda030c 100644 --- a/SDS/sds_cpu.c +++ b/SDS/sds_cpu.c @@ -428,9 +428,31 @@ while (reason == 0) { /* loop until halted */ int_reqhi = api_findreq (); /* recalc int req */ } else { /* normal instr */ - if (sim_brk_summ && sim_brk_test (P, SWMASK ('E'))) { /* breakpoint? */ - reason = STOP_IBKPT; /* stop simulation */ - break; + if (sim_brk_summ) { + uint32 btyp = SWMASK ('E'); + + if (nml_mode) + btyp = SWMASK ('E') | SWMASK ('N'); + else + btyp = usr_mode ? SWMASK ('E') | SWMASK ('U') + : SWMASK ('E') | SWMASK ('M'); + btyp = sim_brk_test (P, btyp); + if (btyp) { + if (btyp & SWMASK ('E')) /* unqualified breakpoint? */ + reason = STOP_IBKPT; /* stop simulation */ + else switch (btyp) { /* qualified breakpoint */ + case SWMASK ('M'): /* monitor mode */ + reason = STOP_MBKPT; /* stop simulation */ + break; + case SWMASK ('N'): /* normal (SDS 930) mode */ + reason = STOP_NBKPT; /* stop simulation */ + break; + case SWMASK ('U'): /* user mode */ + reason = STOP_UBKPT; /* stop simulation */ + break; + } + break; + } } reason = Read (save_P = P, &inst); /* get instr */ P = (P + 1) & VA_MASK; /* incr PC */ @@ -1473,7 +1495,8 @@ pcq_r = find_reg ("PCQ", NULL, dptr); if (pcq_r) pcq_r->qptr = 0; else return SCPE_IERR; -sim_brk_types = sim_brk_dflt = SWMASK ('E'); +sim_brk_dflt = SWMASK ('E'); +sim_brk_types = SWMASK ('E') | SWMASK ('M') | SWMASK ('N') | SWMASK ('U'); return SCPE_OK; } diff --git a/SDS/sds_defs.h b/SDS/sds_defs.h index 8277a144..82955c8b 100644 --- a/SDS/sds_defs.h +++ b/SDS/sds_defs.h @@ -1,4 +1,4 @@ -/* sds_defs.h: SDS 940 simulator definitions +/* sds_defs.h: SDS 940 simulator definitions Copyright (c) 2001-2010, Robert M. Supnik @@ -52,6 +52,9 @@ #define STOP_RTCINS 12 /* rtc inst not MIN/SKR */ #define STOP_ILLVEC 13 /* zero vector */ #define STOP_CCT 14 /* runaway CCT */ +#define STOP_MBKPT 15 /* monitor-mode breakpoint */ +#define STOP_NBKPT 16 /* normal-mode breakpoint */ +#define STOP_UBKPT 17 /* user-mode breakpoint */ /* Trap codes */ diff --git a/SDS/sds_sys.c b/SDS/sds_sys.c index 964975b7..14a03c82 100644 --- a/SDS/sds_sys.c +++ b/SDS/sds_sys.c @@ -96,7 +96,10 @@ const char *sim_stop_messages[] = { "Trap instruction not BRM", "RTC instruction not MIN or SKR", "Interrupt vector zero", - "Runaway carriage control tape" + "Runaway carriage control tape", + "Monitor-mode Breakpoint", + "Normal-mode Breakpoint", + "User-mode Breakpoint" }; /* Character conversion tables */