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
This commit is contained in:
parent
6323acd5ea
commit
e51d918adb
1 changed files with 2 additions and 1 deletions
3
scp.c
3
scp.c
|
@ -8642,6 +8642,7 @@ if ((flag == RU_RUN) || (flag == RU_GO)) { /* run or go */
|
||||||
new_pc = TRUE;
|
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? */
|
if ((flag == RU_RUN) && /* run? */
|
||||||
((r = sim_run_boot_prep (flag)) != SCPE_OK)) { /* reset sim */
|
((r = sim_run_boot_prep (flag)) != SCPE_OK)) { /* reset sim */
|
||||||
put_rval_pcchk (sim_PC, 0, orig_pcv, FALSE); /* restore original PC */
|
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;
|
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) ||
|
else if ((flag == RU_STEP) ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue