sim_instr does not completely follow the outline in the SIMH v3 developer docs. It does not decrease sim_interval in readin mode. Fixing this, I cleaned up some other things: - Move the decrease of sim_interval to after the check for breakpoints, but before the check for ios. This ensures that sim_interval will decrease any time an instruction executes in normal mode, or readin mode executes, or ios is set and the CPU is waiting for ios to clear. (Except the CPU should be clearing ios itself, not waiting for ios to clear, but that fix requires a complete redesign of the I/O routines and belongs in another branch.) - Correctly handle all four combinations of mod_tst and mod_rdin. - When changing from readin mode to normal mode, if cpu_set_mode returns an error, stop with the same error. If cpu_set_mode returns SCPE_OK, either stop or continue execution, depending on the word read from tape. - In petr_boot and in the readin mode code in sim_instr, if the PETR is not attached to a file, return SCPE_UNATT. Never try to read from an unattached unit; I believe this reads standard input and prevents ^E from working. Overall control structure inside the while (reason == 0) loop: - When stopping due to an error, break out of the while loop where possible. - After handling "ios is set", continue, don't run readin/test/normal- mode code. - After handling one readin operation, if the code didn't break out of the while loop, continue, don't run normal-mode code.
Open SIMH machine simulator
This is the codebase of SIMH, a framework and collection of computer system simulators.
SIMH was created by Bob Supnik, originally at Digital Equipment Corporation, and extended by contributions of many other people. It is now an open source project, licensed under an MIT open source license (see LICENSE.txt for the specific wording). The project gatekeepers are the members of the SIMH Steering Group. We welcome and encourage contributions from all. Contributions will be covered by the project license.
The Open SIMH code base was taken from a code base maintained by Mark Pizzolato as of 12 May 2022. From that point onward there is no connection between that source and the Open SIMH code base. A detailed listing of features as of that point may be found in SIMH-V4-status.
PLEASE NOTE
Do not contribute material taken from github.com/simh/simh unless you are the author of the material in question.