SCP Global Fixes ================ INCORPORATED FIXES ------------------ The following modifications to the SCP framework have been incorporated into the global code base and released to the public: 1. PROBLEM: BREAK actions fail if commands contain semicolons. VERSION: 3.10-0 OBSERVATION: Commands that contain semicolons as parameter separators cannot be specified as BREAK actions. For instance, it is very useful to specify debug tracing only within a section of executed code, as in this example: BREAK 100 ; SET CPU DEBUG=INSTR;DATA ; GO BREAK 200 ; SET CPU NODEBUG=INSTR;DATA ; GO RUN However, when the first breakpoint is reached, an error will occur when "DATA" is executed as the second action command. Similarly, an ECHO command cannot be used as a breakpoint action if it contains a semicolon: BREAK 100 ; ECHO Enter the OS command "FILE T;DEV=TAPE" now. ; GO ...as an error will occur when "DEV=TAPE" is executed as a command. Finally, if a BREAK action is another BREAK command, the actions may be grouped with the wrong BREAK. As an example, assume that we want to break at subroutine entry location 200 and examine the A-register content only if it is called from location 100 but not if it is called from elsewhere. This command: BREAK 100 ; BREAK 200 ; EXAMINE A ; GO ...would appear to do it, but it won't. Instead, the EXAMINE A is executed at location 100; the output is: sim> run Breakpoint, P: 00100 sim> BREAK 200 sim> EXAMINE A A: 000000 sim> GO Breakpoint, P: 00200 sim> CAUSE: The search for command separators in the "sim_brk_getact" routine is not context-sensitive. Parameter separators and textual semicolons are seen as command separators. Action command lists visually should be associated with the nearest BREAK command, but instead they are associated with the first one encountered. All of these behaviors are unexpected. RESOLUTION: Modify "sim_brk_getact" (scp.c) to accept an action command or command list enclosed by single or double quotes as a single command. Using the above examples, the addition of surrounding quotes: BREAK 100 ; "SET CPU DEBUG=INSTR;DATA" ; GO BREAK 100 ; 'ECHO Enter the "FILE T;DEV=TAPE" command now.' ; GO BREAK 100 ; "BREAK 200 ; EXAMINE A" ; GO ...causes the INSTR and DATA debug flags to be set and the full ECHO text to be output, instead of failing with "Unknown command" errors, and the EXAMINE command to be the action command for the BREAK 200 command instead of the BREAK 100 command. This is consistent with 4.x behavior. STATUS: Fixed on 2019-04-12. 2. PROBLEM: DO -V is not verbose for nested DO command files. VERSION: 3.10-0 OBSERVATION: Specifying the -V option to the DO command correctly echoes each command in the file as it is executed, including any subsidiary DO commands. However, the commands in those subsidiary files are not echoed. The only way to get a complete log of commands executed by a top-level DO command file is to add the -V option to every DO command line contained therein, and then to every DO command within those subsidiary command files, and so on down to the lowest nested command file level. This is very awkward, especially as all of those added -Vs have to be removed to restore the original echo behavior. CAUSE: Echo status should be but is not propagated to subsidiary DO command invocations. RESOLUTION: Modify "do_cmd" (scp.c) to include echo status in the "flag" parameter of nested calls and to include the command file name in the echo prompt to identify the location of the echoed command. This is consistent with 4.x behavior. STATUS: Fixed on 2019-04-12. 3. PROBLEM: Specifying a second console log file fails to close the first. VERSION: 3.10-0 OBSERVATION: Opening a console log file with the "SET CONSOLE LOG=" command fails to close a previously opened log file. Consequently, the system loses file and stream descriptors, stream buffers, etc. CAUSE: The required "sim_set_logoff" call is missing from the SET CONSOLE LOG command processor. RESOLUTION: Modify "sim_set_logon" (sim_console.c) to call "sim_set_logoff" before attempting to open the new console log file. STATUS: Fixed on 2019-03-01. 4. ENHANCEMENT: Add memory checking to the ASSERT command. VERSION: 3.10-0 OBSERVATION: The MPE Software Kit "reload" command file patches an unfixed bug in a specific version of the operating system with a memory DEPOSIT command. To ensure that the correct version is being used, it is desirable to use an ASSERT command to ensure that the patched location contains the expected (incorrect) instruction. However, ASSERT currently accepts only register names. Unfortunately, the 3000 simulator does not expose a "memory data" register that can be used to verify the content of the location. In addition, as implemented, the nonsensical assertions "ASSERT T &0" and "ASSERT T |1" are allowed and always succeed because the conditional is defaulted to >= 0. These logical operators should only be allowed if a conditional operator is also supplied. RESOLUTION: Modify "assert_cmd" (scp.c) to accept memory addresses as well as register names and to require a conditional operator. STATUS: Fixed on 2019-04-12. 5. PROBLEM: A replacement DO command is used inconsistently. VERSION: 3.10-0 OBSERVATION: A simulator-specific command table specified by setting the "sim_vm_cmd" hook may contain replacements for standard commands. For instance, a replacement DO command processor may be called in place of the standard processor. However, this occurs only for DO commands issued from the SCP prompt. For DO commands within command files, and for the implicit DO commands that execute command-line files and startup initialization files, the standard DO processor is used. This leads to inconsistent behavior. CAUSE: "do_cmd" calls to the standard processor are hard-coded in several places. RESOLUTION: Replace direct calls to "do_cmd" (scp.c) with indirect calls via the "action" field of the "find_cmd" routine. STATUS: Fixed on 2019-04-12. 6. ENHANCEMENT: Add hooks to permit certain extensions to SCP. VERSION: 3.10-0 OBSERVATION: Adding a small number of hooks to SCP and the TMXR library permits the support of required HP simulator behavior while segregating all new content into separate source modules. This allows integration of the HP simulators and SCP without having to patch the SCP sources themselves. When the extension modules are not compiled in, there is no change in base SCP behavior. These extension hooks utilize the same "weak global" and "NULL-initialized global" mechanisms used by the existing VM-specific hooks. The added SCP hooks and explanations are: - A global character pointer "sim_vm_release" that reports the simulator release number in the SHOW VERSION display. This allows HP releases to occur asynchronously with SCP releases, as the SHOW VERSION command will display both the front end version ("V3.10-0") and the back end version ("Release 29"). - A global function pointer "sub_args" that is initialized to point at the local routine that performs argument substitution in command lines. This allows the extension to add new substitution variables, such as the current date and time, to aid automatic OS startup files. - A global character pointer "sim_prog_name" that points at the simulator executable name (i.e., argv [0]) for use by the extension module. This allows command files to invoke a second simulator instance for the 2000F and 2000 Access I/O Processors without hard-coding the simulator path or executable name. - A global variable "sim_ref_type" that indicates the type of named reference (device or unit) resolved by the "find_unit" routine. This allows multiplexer serial port support to differentiate between ATTACH MPX for the Telnet port and ATTACH MPX0 for the serial port. - A check of the return status from the "sim_instr" function and omission of the "fprint_stopped" calls if the value is SCPE_OK to permit simulators to suppress the stop message if desired. This allows automated OS prompts and responses to occur without interleaved simulator stop messages. - Global declarations to expose the existing "sim_brk_act" variable and "sim_brk_clr", "sim_brk_clract", "sim_brk_getact", and "read_line" routines for use by the extension module. The hooks added to the TMXR modules to support operation over host serial ports are: - An extension void pointer "exptr" added to the end of the TMLN structure to permit additional per-line state to be stored. - Global function pointers "tmxr_read", "tmxr_write", "tmxr_show", and "tmxr_close" that are initialized to point at local routines that read and write socket data, show a connection, and close a socket. - Global declarations to expose the existing "tmxr_find_ldsc" and "tmxr_send_buffered_data" routines for use by the extension module. In addition, existing code is rearranged into new global "tmxr_init_line", "tmxr_report_connection", and "tmxr_disconnect_line" routines to allow reuse by the extension module. RESOLUTION: Modify scp.c, scp.h, sim_tmxr.c, and sim_tmxr.h to add extension hooks. STATUS: Fixed on 2019-04-13. 7. ENHANCEMENT: Add argument substitution to the interactive command line. VERSION: 3.10-0 OBSERVATION: Simulator startup arguments and DO command arguments may be referenced in commands by the special substitution sequences %0 through %9. If a startup command file fails, it would be helpful if these substitutes could be examined at the "sim>" prompt, especially if the host command shell is also performing argument substitution itself. Unfortunately, this does not work, e.g., entering "ECHO %1" interactively prints "%1" rather than the argument's value, resulting in inconsistent interpretation. RESOLUTION: Modify "main" (scp.c) to call "sub_args" in the main command loop. This is consistent with 4.x behavior. STATUS: Fixed on 2019-04-13. 8. PROBLEM: Cannot show console debug, log, and Telnet settings concurrently. VERSION: 3.10-0 OBSERVATION: Section 3.12 ("Console Options") of the SIMH User's Guide says, "Both SET CONSOLE and SHOW CONSOLE accept multiple parameters, separated by commas...." While this works for some parameters, e.g.: sim> SHOW CONSOLE WRU,PCHAR WRU = 5 pchar mask = 23600 ...it fails for others, e.g.: sim> SHOW CONSOLE LOG Logging disabled sim> SHOW CONSOLE DEBUG Debug output disabled sim> SHOW CONSOLE LOG,DEBUG Debug output disabled sim> SHOW CONSOLE LOG,DEBUG,TELNET,WRU WRU = 5 The LOG, DEBUG, and TELNET options fail to show anything if any one is not the last (or only) parameter. CAUSE: The "sim_show_console" routine is correctly parsing the parameter names and calling the correct action routines. However, to each action routine, it passes the remainder of the command line to that point in the "cptr" parameter. For the last example above, it passes "DEBUG,TELNET,WRU" to the "sim_show_log" routine. That routine, as well as the "sim_show_debug" and "sim_show_telnet" routines, check that "cptr" points to an empty string and returns SCPE_2MARG if not. "sim_show_console" discards errors, so nothing is printed for these routine calls. RESOLUTION: Modify "sim_show_console" (sim_console.c) to pass an empty string to the action routine instead of the remainder of the command line. STATUS: Fixed on 2019-06-14. 9. ENHANCEMENT: Add a hook to permit extending the radix overrides. VERSION: 3.10-0 OBSERVATION: Currently, the EXAMINE, DEPOSIT, and EVAL commands permit the user to override the data radix temporarily by specifying -O (octal), -D (decimal), or -H (hexadecimal) switches on the command line. In addition, the SET OCTAL/DECIMAL/HEX commands may be used to change the default data radix. It is sometimes helpful to use binary notation. For example, a 16-bit device register might contain a count in the lower byte and individual bit flags in the upper byte. When examining the count, an octal or hex display might be of best value. However, when examining the bit flags, a binary display might be desirable. The logical extensions -- adding a -B switch and a SET BINARY command -- cannot always be used, as some simulators use the -B switch for other purposes (e.g., the PDP-11 simulator uses it to indicate byte access). It would be better, then, to provide a hook for this feature, so individual simulators can elect whether to provide additional radix overrides and to select the switches and command keywords to use for this purpose. RESOLUTION: Modify scp.c and scp.h to declare a new "sim_get_radix" function hook and initialize it to point at a new "get_radix_local" function that implements the prior macro statement. Modify the "GET_RADIX" macro (scp.c) to call via the "sim_get_radix" function pointer to get the optional radix override, and modify the "set_cmd" function to call via "sim_get_radix" to see if a SET is a radix-override keyword. STATUS: Fixed on 2019-07-19. 10. ENHANCEMENT: Add a hook to allow SCP extensions to control the TMLN extension pointer more flexibly. VERSION: 3.11-0 OBSERVATION: An extension void pointer "exptr" was added to the end of the TMLN structure to permit additional per-line state to be stored. Existing TMXR routines were modified to inhibit standard line behavior if the pointer was not null. However, there are cases where an extension may want standard line behavior while still keeping additional line state. A more flexible solution is to call an extension routine to determine whether standard behavior is desired. RESOLUTION: Modify sim_tmxr.h and sim_tmxr.c to declare a new Boolean "tmxr_is_extended" function hook and initialize it to NULL. If the hook is overridden, call the function to determine if standard or extended behavior is desired in the "tmxr_poll_rx", "tmxr_open_master", and "tmxr_close_master" routines. STATUS: Fixed on 2019-12-19. 11. ENHANCEMENT: Add a hook to allow the VM to supply names for units not associated with devices. VERSION: 3.11-0 OBSERVATION: A virtual machine may use "bare" units (i.e., units not associated with devices) to time and service internal events. Such a unit will be displayed as "Unknown" in a SHOW QUEUE report. If the VM uses more than one such unit, the user cannot differentiate between their SHOW QUEUE entries, all of which will be labeled as "Unknown." It would be better if the VM could supply the display names for such units, as SCP already does for its own STEP timer unit. RESOLUTION: Declare a new "sim_vm_unit_name" hook function pointer (scp.h) that, if set by the VM, will be called to obtain the display name of each unit listed in the SHOW QUEUE report. The VM-supplied routine returns a pointer to a character string describing each unit it recognizes, or NULL for each unit that it doesn't. Modify "show_queue" (scp.c) to call the VM-provided function if the hook pointer has been set. STATUS: Fixed on 2020-01-09. 12. PROBLEM: Terminal multiplexer logs are not closed on simulator exit. VERSION: 3.11-2 OBSERVATION: Before exiting, the "main" routine in SCP closes all open files associated with the console log, the debug log, and all attached device units. It does not close any logs associated with terminal multiplexer lines. CAUSE: Terminal multiplexer log file objects are kept in the TMLN structures that describe mux lines. A pointer to the TMLN array is kept in the TMXR structure that describes a multiplexer device. These structures are declared in the simulator's VM-specific device modules. However, no external reference to TMXR structures is provided, so there is no way to discover any open line logs that need to be closed. RESOLUTION: Modify "tmxr_set_log" (sim_tmxr.c) to store each unique TMXR pointer parameter in a descriptor table when a log file for one of that multiplexer's lines is opened. Add a new "tmxr_post_logs" routine that walks through the table and each associated TMLN array to flush or close each open log file. STATUS: Fixed on 2020-10-23. 13. PROBLEM: Simulator stops do not flush terminal multiplexer logs. VERSION: 3.11-2 OBSERVATION: While a simulation stop flushes all console logs and attached device files, active logs for terminal multiplexer lines are not. The only way to flush a line log is to close and then reopen the log file. CAUSE: No external references to the simulator's multiplexer line descriptor arrays are provided, so there is no way to discover any open line logs that need to be flushed. RESOLUTION: Modify "run_cmd" (scp.c) to include a call to the new "tmxr_post_logs" routine to flush all active terminal multiplexer line logs after a simulation stop. STATUS: Fixed on 2020-10-23. 14. ENHANCEMENT: Provide a -N (new file) switch for the SET LOG command. VERSION: 3.11-2 OBSERVATION: Specifying an existing log file for a multiplexer line appends line data to the end of the file. There is no way to request a new, blank log file except by using the spawn command to delete the log file via the host platform's operating system. Note that the SET CONSOLE LOG, SET CONSOLE DEBUG, and ATTACH commands honor the -N switch to create a new file. The SET LOG command should as well. RESOLUTION: Modify "tmxr_set_log" (sim_tmxr.c) to check for the -N switch and to open the log file for writing instead of appending if detected. STATUS: Fixed on 2020-10-23. 15. ENHANCEMENT: Allow a user-specified multiplexer line order to omit lines. VERSION: 3.11-2 OBSERVATION: In specifying a multiplexer line order connection, a user may wish to omit certain lines. For example, the HP 1000 8-channel multiplexer requires software configuration of each line that is to be used. Lines that are not configured appear dead, so the user may wish to limit connections to configured lines. As another example, a user providing remote Telnet access to an HP 2000 Time-Shared BASIC system via its 16-channel multiplexer may wish to restrict access to a smaller number of concurrent sessions. Currently, if a user specifies a subset of a multiplexer's lines in a "SET LINEORDER" command, the unspecified lines will be appended sequentially to the connection list. For instance, if a "SET MPX LINEORDER=1-4" command is given to the HP 1000 mux, the connection order will be set to "1, 2, 3, 4, 0, 5, 6, 7". There is no way for the user to specify that connections should be made only to lines 1 through 4 and that additional connection attempts should receive the "All connections busy" message. The line order command should be redefined to omit lines that are not specified from the connection order and to append omitted lines if the final parameter is "ALL". So "1-4" will specify connections only to lines 1-4, and "1-4;ALL" will provide the current behavior of 1-4, 5, 0, 6, 7. RESOLUTION: Modify "tmxr_set_lnorder" and "tmxr_show_lnorder" (sim_tmxr.c) to provide for user-specified line omission and "tmxr_poll_conn" to omit lines that the user has specified should not be connected. STATUS: Fixed on 2020-10-27. 16. PROBLEM: REG implied access widths constrain variable type selections. VERSION: 3.11-2 OBSERVATION: The REG structure used to define device registers for the EXAMINE and DEPOSIT commands does not have a field describing the size of the underlying variable. Instead, that size is implied by a combination of the "width", "offset", "depth", and "flags" fields. For "depth" > 1 (i.e., arrays), the access size is implied by the smallest integer type that will contain a field of "width" bits shifted "offset" bits to the left. For "depth" = 1 (i.e., scalars), the access size is 32 bits, unless "flags" contains the REG_FIT flag, in which case the access size is implied by the "width" and "offset" as for arrays. In practice, this can lead to subtle errors if the target variable type does not match the implicit assumption. For example, an 8-bit scalar variable used in a "depth" = 1 register will "work" if the host platform is little-endian but will fail by punching a hole in a variable adjacent in memory if the host is big-endian. Similar problems occur if a "depth" > 1 register specifies a "width" that implies a different element size than declared (e.g., "width" = 16 for a 32-bit integer array). Such problems are particularly insidious if they occur when the underlying type is changed in a way that invalidates the sizing assumption. For example, the foregoing arrayed register that worked properly when the element was "uint16" would fail silently when it was changed to "uint32". No indication of the error is given, except by latent failure in other variables if a DEPOSIT is done to the affected register. Further, it is impossible to have two register views into the same array if the field locations imply different element sizes. For instance, registers displaying two single-bit flag fields within the same word, one located at offset 0 and the other at offset 8, cannot be specified because the first implies 8-bit elements, while the second implies 16-bit elements. CAUSE: The access size of a given variable is unrelated to the physical size of the variable. The compiler knows the sizes of variables, reflected in the result of the "sizeof" operator, but that information is not used to determine the size of access. Instead, a size implied by several tangentially related field values is used. This reliance on the programmer to set and maintain accuracy is problematic, and errors are not easily detected. Also, some register relationships are impossible to specify, and the implied access sizes may force the programmer into using suboptimal variable types to satisfy the sizing algorithm. RESOLUTION: Modify the REG structure (sim_defs.h) to add a "size" field that reflects the access size in bytes of the underlying variable, modify the REG macros (ORDATA, etc.) to initialize the field to the "sizeof" the supplied variable, and redefine the REG_FIT value to 0, as it is now unnecessary. Modify the SZ_R macro (scp.c) and its uses to use the "size" field for the access size instead of the previous sizing algorithm. STATUS: Fixed on 2021-01-25 17. ENHANCEMENT: Add generic array-of-structure-fields registers. VERSION: 3.11-2 OBSERVATION: The REG structure permits definition of arrays of numeric elements (BRDATA) and arrays of UNIT structure fields (URDATA) but not arrays of general structure fields. However, such arrays are possible if the REG structure stored the "stride" of the array (i.e., the byte distance between array elements). UNIT field access is implemented with a special flag (REG_UNIT) and an assumption of the size of the structure. If the size of the structure were supplied explicitly, then registers describing an array of fields would be possible. RESOLUTION: Modify the REG structure (sim_defs.h) to add a "stride" field that reflects the size of array elements, and modify the REG macros to initialize the "stride" to zero for scalars and to the element spacing for arrays. Modify the URDATA macro to use the stride of the UNIT structure, rather than the REG_UNIT flag, to indicate an array-of-fields access, and add a new SRDATA macro to initialize a general array-of-fields register. Rewrite the "get_rval" and "put_rval" routines (scp.c) to use the new "stride" field to access arrays-of-fields and eliminate the special cases for REG_UNIT, which is now unnecessary. STATUS: Fixed on 2021-02-16. 18. PROBLEM: The magnetic tape library cannot erase data record residue. VERSION: 3.12-0 OBSERVATION: The tape library "sim_tape_wrgap" routine is called to write an erase gap on a mag tape image file. However, if erasing existing tape data, the starting position of the gap must coincide with a valid tape metadata marker, i.e., a leading record length, end-of-file, end-of-medium, or erase gap marker. If a gap starts in the middle of a data record, e.g., if it follows a shorter record written over a longer one, the tape image may be corrupted. Consider a tape constructed as follows: 1. Starting at the BOT, write a data record of 100 bytes. 2. Write a data record of an arbitrary size. 3. Rewind. 4. Write a data record of 50 bytes. At this point, the remainder of the 100-byte record cannot be erased reliably. Calling "sim_tape_wrgap" to erase the remainder will do so successfully and will return MTSE_OK, but bytes in the data record following the erasure may be changed as well. CAUSE: "sim_tape_wrgap" calls the internal "tape_erase_fwd" routine to write the erase gap. That routine attempts to ensure that erasure does not leave an invalid tape image by reading through the image, starting at the initial gap position, until enough bytes to accommodate the gap have been seen before actually writing the block of erase gap markers. It does this so that if an existing data record straddles the end of the gap, such that the leading part of the record will be erased, the record is truncated by rewriting the starting and ending length words to reflect the new length remaining beyond the gap. This maintains tape format integrity. The process works only if the starting position begins a valid sequence of tape markers. If it begins instead with previously recorded data, as may occur if a shorter record is written over a longer one, then data bytes will be interpreted as metadata markers. If the interpretation is that of a data record extending beyond the end of the gap, the bytes corresponding to the locations of the leading and trailing length words of the shortened record will be rewritten, causing the trailing length word to overwrite data within the real record following the gap. The situation is exacerbated by the current code identifying data records in the region to be erased solely by their leading length words. The code does check that the record would not extend beyond the physical end of the file, but it does not verify that the trailing length word matches the leading length word. This would help prevent "leftover" bytes from being misinterpreted as valid record metadata. RESOLUTION: Add a new "sim_tape_erase" function (sim_tape.c, sim_tape.h) that erases a gap without checking the existing content, and extract the gap-writing code from "tape_erase_fwd" function into a new internal "tape_erase" routine that is called from both functions. Also, improve record identification in "tape_erase_fwd" by verifying that the leading and trailing length words match before deciding that an erased data record must be truncated. STATUS: Fixed on 2021-10-10. 19. PROBLEM: Using ENTER with IDEPOSIT does not honor address increment flags. VERSION: 3.12-0 OBSERVATION: The IDEPOSIT command displays the data value at an address and allows the user to change it by entering a new value or to keep the old value by pressing ENTER without a value. In either case, the next address in the range is displayed, as determined by the presence of command-line switches. For example, the PDP-11 is a byte-addressable machine that normally accesses words at even byte addresses. It responds to the -B switch by accessing bytes at successive addresses: sim> id -b 0-5 0: 1 1: 2 2: 3 3: 4 4: 5 5: 6 However, if ENTER is supplied to skip a value, the address increment reverts to words: sim> id -b 0-5 0: 0 1: 1 2: 4: 4 5: 5 When 2 is skipped, the simulator never offers 3 and instead goes on to 4. If ENTER is supplied for all values, word increments are used exclusively: sim> id -b 0-5 0: 2: 4: CAUSE: The "dep_addr" routine is called to deposit each value. After obtaining the user's response, it calls the "parse_sym" routine in the VM to obtain the numeric value to deposit. Address-increment switches are handled in "parse_sym", which returns the proper increment to apply. However, if a value is not entered, "parse_sym" is never called, and the default increment (dptr->aincr) is used instead. In the PDP-11 case, "aincr" is 2, so a word increment is applied. RESOLUTION: Modify "exdep_addr_loop" to call "parse_sym" with a dummy numeric value to obtain the default address increment for the given command-line switches. Modify "ex_addr" to add a default increment parameter that is returned instead of "dptr->aincr". STATUS: Fixed on 2021-10-21. 20. ENHANCEMENT: Extend the tape format to allow private records and markers. VERSION: 3.12-0 OBSERVATION: The CS/80 cartridge tape simulator needs to represent tape blocks that have been erased and not yet written. This condition exists when a formatted tape is initialized but not certified. Attempting to read such a block returns No Data Found status. This is different from a data record of any length or a tape mark. What is needed is a "private" marker that can be written to a tape block to indicate this "third" state. RESOLUTION: Modify sim_tape.c and sim_tape.h to extend the existing SIMH tape format to define new classes of data records and markers. Currently, the MSB of the metadatum word is assigned to a "good/bad" tape record indicator, and the next three bits are reserved. Combining these four bits into a one-of-sixteen class designator provides private and SIMH-reserved tape record classes, plus one private one and SIMH-reserved marker class. One arbitrary private marker is assigned for CS/80 "erased tape block" use. STATUS: Fixed on 2021-12-15. 21. ENHANCEMENT: Add expanded MTAB support. VERSION: 3.12-4 OBSERVATION: Regular MTAB entries provide a simple and convenient method of allowing the user to modify the flags fields in UNIT structures. But while DEVICE structures also have flags fields, and some simulator options are logically placed in these fields, there is no comparably simple way of allowing the user to modify them. Instead, the developer must use "extended" MTAB entries and provide validation and display routines that often do little more than duplicate the setting, clearing, or testing of bits in the target field. Another common action is parsing and setting or displaying a numeric value in a field. It would be much more convenient if these actions could be handled with the simplicity of UNIT flags modification. An expansion of the current SET and SHOW commands would retain these forms: SET SET ...but would be expanded to modify the DEVICE flags field, any other specified field within DEVICE or UNIT structures (e.g., "u3"), a global scalar value or an element of an array of scalars whose index corresponds to the specified unit number, or a numeric value field located within any of these locations. The latter would automatically handle commands of the form: SET = ...and provide configurable radix interpretation and optional minimum and maximum allowable values for the supplied number. RESOLUTION: Add new "set_emod", "show_emod", and "target_emod" routines (scp.c) to implement expanded MTAB processing. Modify "set_cmd", "show_cmd_fi", "show_all_mods", and "show_dev_show_commands" (scp.c) to use the expanded MTAB routines when processing entries of that type. STATUS: Fixed on 2023-05-29. 22. PROBLEM: Logical unit names are rejected if the base name is a prefix. VERSION: 3.12-4 OBSERVATION: If a logical name is assigned to a device, and the name includes the base device name as a prefix, then the units cannot be manipulated using the logical name. For example: sim> show tty TTY, fast timing, select code=11, 3 units TTY0, UC TTY1, UC TTY2, not attached, 8b sim> assign tty ttya sim> show ttya TTYA, fast timing, select code=11, 3 units TTYA0, UC TTYA1, UC TTYA2, not attached, 8b sim> show ttya0 Non-existent device sim> CAUSE: The "find_unit" routine searches the base device name for a match before trying to match the logical name. In the example, the base device name "TTY" matches the first part of "TTYA0", but then the routine attempts to find a digit as the next character, and when it doesn't, it moves on to the next device. After all devices are checked without finding a match, the routine returns NULL to its caller, which responds by returning SCPE_NXDEV. RESOLUTION: Modify "find_unit" (scp.c) to check the logical device name if the base name matches but the numeric check fails. STATUS: Fixed on 2023-06-08. 23. PROBLEM: Compiler warning when printing SOCKET values on 64-bit systems. VERSION: 3.12-4 OBSERVATION: For a connected Telnet session, the SHOW CONSOLE TELNET command prints the port number and socket number, e.g., "Listening on port 1054 (socket 132)." Compiling the associated print statement on a 64-bit Windows system with VC++ 2022 produces: SCP\sim_console.c(429): warning C4477: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 2 has type 'SOCKET' SCP\sim_console.c(429): note: consider using '%lld' in the format string SCP\sim_console.c(429): note: consider using '%Id' in the format string SCP\sim_console.c(429): note: consider using '%I64d' in the format string CAUSE: Windows defines the SOCKET type as a UINT_PTR, which is 32-bits wide on a 32-bit system and 64-bits wide on a 64-bit system. The latter is mismatched to the "%d" format statement, which specifies a 32-bit decimal value. There is an additional location in "tmxr_open_master" that prints a SOCKET value, but it is not flagged by the compiler because it calls "sim_printf" instead of "fprintf". The SOCKET value is considered by Windows to be an opaque type, so reporting it is not overly useful. RESOLUTION: Modify "tmxr_open_master" (sim_tmxr.c) to drop reporting of the SOCKET value, and modify "sim_show_telnet" (sim_console.c) to replace the report of the SOCKET value with the connected port number. STATUS: Fixed on 2024-03-27. 24. PROBLEM: SHOW DEV says "all units disabled" even when user cannot enable. VERSION: 3.12-4 OBSERVATION: When a device has a mixture of enabled units, user-disabled units, and permanently disabled units, the SHOW DEVICE command purposely excludes the last category when reporting the number of units. For example, the HP3000 MA device declares six units, but SHOW MA reports: MA, fast timing, channel 9, bus=0, 4 units MA0, not attached, ,,, MA1, not attached, ... MA2, not attached, ... MA3, not attached, ... ...because the two internal-use units are flagged with UNIT_DIS and without UNIT_DISABLE. Disabling one, two, or three of the four user units hides them from the display but does not change the "4 units" report. Disabling the fourth user unit reports: MA, fast timing, channel 9, bus=0, all units disabled ...showing that although no units are displayed, there are units that may be reenabled by the user. The GIC unit also has two internal-use, permanently disabled units but no user-manipulable units. Its SHOW GIC display is: GIC, channel 11, ..., system controller, all units disabled This is inconsistent with the MA display because the permanently disabled units are not being excluded from the report of "all units disabled." It is also misleading because there are no units that the user may reenable. If UNIT_DIS is removed from both internal units, then they become visible to the user, which is undesirable: GIC, channel 11, ..., system controller, 2 units GIC0 GIC1 If only one of the two internal units has UNIT_DIS removed, then the display is: GIC, channel 11, ..., system controller ...which correctly reflects that the GIC device has no units that can be manipulated by the user. CAUSE: The "show_device" separately counts the number of enabled units ("ucnt") and the number of user-disabled units ("udbl"). It uses the sum, which excludes the count of permanently disabled units, when reporting the number of units to the user. However, it uses only the count of enabled units to determine whether to display or omit the "all units disabled" message. The message should be displayed only when there are no enabled units because the user has disabled all of them, i.e., when ucnt is zero and udbl is greater than zero. RESOLUTION: Modify "show_device" (scp.c) to display the "all units disabled" message only when the user has caused the condition. STATUS: Patch created on 2024-05-03. 25. ENHANCEMENT: Add a VM hook for simulator shutdown. VERSION: 3.12-5 OBSERVATION: SCP provides a VM-settable hook ("sim_vm_init") that is called once during simulator startup. This allows the VM to initialize any required settings prior to simulator execution. The VM also receives notification of simulator shutdown via calls to device-specific detach routines for non-attachable units. However, the VM cannot inhibit shutdown with this mechanism; regardless of whether the detach routine returns SCPE_OK or an SCPE error code, shutdown continues unimpeded. A simulator may have reason to deny a shutdown request. For example, the user may have configured the simulator to populate an in-memory buffer, e.g., of performance statistics, that would be lost when shutdown occurs. The VM may wish to warn the user that the data has not been viewed or saved and ask for confirmation before continuing to exit. Currently, there is no way to do this, except by adding the EXIT, QUIT, and BYE commands to the VM command table and overriding the default handler to point at a VM routine. It would be cleaner and easier if SCP provided a hook, e.g., "sim_vm_shut", that could be set by the VM during initialization to point at a confirmation routine. If the routine returned SCPE_EXIT, then shutdown would continue; otherwise, simulator operation would continue after printing the message corresponding to the returned SCPE error code. RESOLUTION: Modify "scp.h" to add a new VM hook, and modify "exit_cmd" (scp.c) to call the hook function, if set, and return its value in lieu of SCPE_EXIT. STATUS: Patch created on 2024-09-16. 26. PROBLEM: Calling "tmxr_reset_ln" can cause the simulator to exit. VERSION: 3.12-5 OBSERVATION: The HP 3000 simulator provides a command to reduce the terminal multiplexer (ADCC device) from eight ports to four, corresponding in hardware to removing the multiplexer extender card from the system. When issuing this configuration command on a Unix system that employs the "editline" library, the simulator exits immediately: Dave /opt/src/SIMH $ ./hp3000 HP 3000 simulator V3.12-5.1 Release 14 sim> set cpu s58 sim> set adcc noextender sim> Dave /opt/src/SIMH $ Note that the usual "Goodbye" message that accompanies simulator exit is not printed. CAUSE: In the HP 3000 ADCC module, the upper four ports that are going to disappear are first disconnected by calling "tmxr_disconnect_ln" on each of the four disappearing lines. This is done to ensure that any existing Telnet sessions won't be left hanging. That routine calls "tmxr_reset_ln", which calls "tmxr_close" to close the port socket. Each of the intervening routines are protected internally from being called for a closed port. However, "tmxr_close" (a pointer to the default "tmxr_local_close" routine) calls "sim_close_sock", which calls "shutdown" with the connection socket. This call is not protected. When called for a closed port, "shutdown" is passed a socket value of 0. This is interpreted on Unix systems as a request to close the stdin file handle (on Windows systems, this call is rejected as passing an invalid socket handle). When execution returns to the "sim>" prompt and attempts to read from stdin via the "readline" routine, that routine returns NULL to the main command execution loop. Because stdin has been closed, the subsequent "sim_isatty" call returns FALSE. The two conditions necessary for an unceremonious exit from the command loop now exist, and the simulator quits silently. RESOLUTION: Modify "tmxr_local_close" (sim_tmxr.c) to check that the port socket is open before calling "sim_close_sock". STATUS: Patch created on 2024-11-08. ——————————————————————————————————————————————————————————————————————————————— xxx. PROBLEM: VERSION: 3.12-4 OBSERVATION: CAUSE: RESOLUTION: STATUS: Fixed on xxx. ENHANCEMENT: VERSION: 3.12-0 OBSERVATION: RESOLUTION: STATUS: Fixed on