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.
and pad with cry. When it decoded cry, it printed a "TO DO" message.
http://bitsavers.org/pdf/mit/tx-0/memos/M-5001-19_macros_Apr60.pdf
derives a simple algorithm for cry. Implement that, remove the test
for cry from the pad code, and reformat the debug messages.
The same change appears in sim_instr and sim_opr_orig.
* CMake build infrastructure
The squashed commit that builds and packages releases for the SIMH
simulator suite with CMake, version 3.14 or newer.
See README-CMake.md for documentation.
Coverity is confusing routines by the same name from different simulators.
Making these routines static should solve the problem.
Also fix un-checked status complaint.
This avoids a potential invalid pointer dereference when formatting
the return value from sim_instr() if it is < SCPE_BASE but greater
than the previously defined static array size.sizeof
Update simh.doc to reflect this generic change.
Most history routines defined a local sim_eval of the proper length, but the
erroneous ones were fixed length machines that defined an integer variable
instead of an integer array of length 1. The VAX used the global sim_eval.
The changes follow the VAX practice.
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.
Most simulators can now also be compiled with a C++ compiler without
warnings.
Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
Both VT11 and VS60 properly autoconfigure on the PDP11.
PDP11 now runs Lunar Lander on all SDL supported platforms.
Reworked refresh logic to not require internal delays in the display library
This reverts commit 5551a0dd9c.
The original idea was that the state being put into simh registers would be required to have all useful information available when remote console executed commands. These steps were taken from the code that sim_instr() executed as it was exiting. After this change was made it was realized that once a remote console command executed it might change state that directly affected instruction execution. To solve this, the logic that executes before the instructions in sim_instr() would then need to be executed whenever the event dispatch processing completed. This approach is messy, burdensome and potentially a lot of overhead for every event dispatch even though almost none of the event dispatches would be for remote console command execution. A completely different approach was suggested by J. David Bryan. That alternative approach would be to have remote console commands execute outside of the sim_instr() routine. Thus allowing the existing prelude and postlude code in sim_instr() to be performed naturally and let the remote console activities run in the same context as all other simh commands. Recent changes to scp and sim_console implement this alternative approach and thus these original changes are completely irrelevant and are thus being removed.
Follow proposal described in issue and change LP register to LPEN. LP
is still the name of the register when using SIMH to examine or deposit
to this register.