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.
The code is a bit difficult to understand, but it represents the 'normal'
path for processing a DECtape word. The code always flows all the
way to the break.
For start of block, there's extra code to check for a timing error; but
then the first word is processed (case 0).
For a normal word, a 3-cycle data break is done - increment word
count and current address, check for word count overflow, put the
word in the buffer; but then check for end of block (case DTO_WCO).
If the word count has already overflowed, just check for end of block.
So yes, the end of case 0 should be labeled 'fall through' as well.
FNC_WRIT has the same structure and needs the same comment.
For the PDP11, this includes deferring the setting of DONE on an error, allowing RSTS V4 to work correctly.
There was a minor (possibly only theoretical) bug in dt_seterr as well.
dt_seterr is supposed to stop the drive. If the drive is accelerating, at
speed, or stopped, it works fine. But if the drive is decelerating, it did
not clear out the "successor" states. In theory, the drive could be in the
middle of reversing - that is, there are successor states of accelerating
(in reverse) and at speed. So the successor states need to be cleared,
or the drive won't actually stop.
The fifth DECtape controller (the PDP8's TD8E) is much simpler and
doesn't have the problem.
It was defined in lowercase and has now been made upper case for consistency.
The code which performs the match also has been change to do a case
insensitive compare.
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.
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.
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.
Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
Finishing the last DECtape device which was missed when this functionality was added to pdp11_dt, pdp18b_dt and pdp8_dt
in commits: 2934112a70 and c9e8121c16
Cleaned up the pdp11, pdp18b and other pdp8 implementations to make backporting cleaner.
Made sure that buffer flushing happens correctly when simulation returns to the sim> prompt.