From e51d918adbddb1a379657cfaf38cb67e94769dd0 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 13 Mar 2021 12:38:39 -0800 Subject: [PATCH] SCP: Assure consistent PC state while preparing RUN command execution Some simulator reset routines may reference the RUN target PC value while others may change the PC, so we set the PC value both before and after any reset is performed. As reported in #1020 --- scp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scp.c b/scp.c index d46585d4..e185e73b 100644 --- a/scp.c +++ b/scp.c @@ -8642,6 +8642,7 @@ if ((flag == RU_RUN) || (flag == RU_GO)) { /* run or go */ new_pc = TRUE; } } + put_rval_pcchk (sim_PC, 0, new_pcv, new_pc); /* Save in PC in case reset references PC */ if ((flag == RU_RUN) && /* run? */ ((r = sim_run_boot_prep (flag)) != SCPE_OK)) { /* reset sim */ put_rval_pcchk (sim_PC, 0, orig_pcv, FALSE); /* restore original PC */ @@ -8674,7 +8675,7 @@ if ((flag == RU_RUN) || (flag == RU_GO)) { /* run or go */ } sim_switches = saved_switches; } - put_rval_pcchk (sim_PC, 0, new_pcv, new_pc); /* Save in PC */ + put_rval_pcchk (sim_PC, 0, new_pcv, new_pc); /* Save in PC again in case reset changed it */ } else if ((flag == RU_STEP) ||