SIMH LOCAL FIXES ================ REJECTED FIXES -------------- The following modifications have been rejected for inclusion into the global code base; the modifications are maintained locally: 1. PROBLEM: The DO -E command continues to execute commands after a VM error. VERSION: 3.8-1 OBSERVATION: According to the manual, when invoking a DO command file and specifying the -E switch, "command processing (including nested command invocations) will be aborted if any error is encountered." Errors that occur as a result of commands, e.g., an invalid unit name supplied to the ATTACH command, correctly terminate the DO command. However, errors that occur when running the simulated CPU (e.g., a host I/O error) do not; the error is printed on the console, but the command file continues to execute. CAUSE: When the -E switch is specified, the DO command processor checks the return status from each command invoked and aborts execution of the command file if the return is not SCPE_OK. When a RUN, GO, STEP, CONT, or BOOT command is invoked, the run command processor calls the VM-provided instruction execution function to start the simulation. When simulation is stopped, the instruction executor returns a status code to indicate why execution has stopped. The reason might be a VM-defined condition (e.g., execution of a "halt" instruction) or a system condition (e.g., a host file system I/O error). The run command processor uses this code to print an error message, but then returns SCPE_OK to the caller. As the DO command processor never sees the error message, it continues to execute commands. RESOLUTION: Modify sim_defs.h to define SCPE_VMERROR and SCPE_VMSTOP as SCPE_BASE-1 and -2, respectively. Modify "run_cmd" (scp.c) to return either SCPE_VMSTOP (for all VM stops and for SCPE_STEP) or SCPE_ERROR (for all system errors). Modify the error checker "do_cmd" to continue if the return status is a VM stop and abort if it is a VM or system error. STATUS: Local patch created 2012-03-18. 2. ENHANCEMENT: Alter the "do" command to retry the command file open with an extension of ".sim" if the original open fails. VERSION: 3.2-1 OBSERVATION: It's helpful to assign command files an extension for sorting and classification purposes, and it's additionally helpful if that extension is assumed when not specified. For example, entering "do rte" should first look for a commmand file named "rte" and then for one named "rte.sim". RESOLUTION: Alter "do_cmd" (scp.c) to copy the filename to "cbuf", append the extension, and retry the file open if the first attempt fails. STATUS: Local patch created 2004-07-17. 3. ENHANCEMENT: Add commands to halt simulation after a specified delay when a given text string is output to the console and to specify a response string to use for the next console input. VERSION: 3.3-0 OBSERVATION: Many repetitive tasks, such as system boot-up, might be automated if SIMH could detect prompts from the simulated program and supply responses. This capability would be especially useful for automating long and tedious interactions, such as running diagnostics or system generations. While sophisticated third-party tools exist for this purpose (e.g., "expect"), many tasks require only simple prompt-and-response interactions. The SET CONSOLE HALT command halts execution of the simulated program when a specified string of characters have been seen in the console output stream. The syntax is: SET {-A}{-I} CONSOLE HALT= At the end of each output line (delineated by a line-feed character, octal 12), the line is searched for the presence of the specified . If the is present anywhere in the line, the simulated program is halted with a "Console halt" stop message. The message will be suppressed if the simulator RUN (or GO or CONTINUE or STEP) command originated in a DO command file that was not invoked with -V. If the -A ("anchored") switch is specified, the must start at the beginning of the output line for a successful match to occur. If the -I ("immediate") switch is specified, a successful match will occur as soon as the is seen in the output stream; matching is not delayed until the line-feed is seen. Control characters may be specified in the by the two-character escape sequence "~c", where "c" is the key that would be pressed with the CONTROL key. For example, "~m" would designate CONTROL-M (carriage return). To specify a literal "~", use "~~". A console halt condition remains in effect until replaced by another or until cancelled with: SET CONSOLE NOHALT The current console halt matching string may be displayed with: SHOW CONSOLE HALT The SET CONSOLE RESPONSE command specifies characters to be supplied to the program running under simulation as though they were typed at the console. The syntax is: SET CONSOLE RESPONSE= The response string may contain escaped control characters. The characters of the response string are supplied to the console terminal handler until the entire string is consumed. A pending console response may be cancelled with: SET CONSOLE NORESPONSE The pending console response may be displayed with: SHOW CONSOLE RESPONSE As the console is not buffered, a delay is typically required between the prompt output and the response input. When a successful console halt match occurs, the simulated program is halted after a delay specified by: SET CONSOLE DELAY= where is an instruction count. This delay is initially zero but generally must be set to allow the simulated program enough time to issue a read to the console before the response is supplied. If the delay is too short, the response characters will be lost. The current console halt delay may be displayed with: SHOW CONSOLE DELAY RESOLUTION: Modify "sim_console.c" to add the above commands. STATUS: Local patch created 2004-11-15. PROBLEM: A console halt occurs a second time if an anchored halt string occurs a second time in the output buffer. VERSION: 3.8-1 OBSERVATION: The RTE File Manager outputs a colon as a prompt character. Attempting to halt when the prompt appears with "set -a -i console halt=:" work as expected. However, if the line that is input in response also contains a colon, a second console halt occurs. This is unexpected, because the match should be anchored to the start of the line. CAUSE: The output buffer is cleared only when a line feed is output. The prompt writes a colon to the first character of the buffer, and this matches the halt criteria. When the program is resumed, characters 2-N are written to the buffer as they are echoed from the keyboard. When a second colon is entered, the criteria test is triggered, and because the first character still contains a colon, the halt criteria matches again. RESOLUTION: Change the anchored halt criteria test in sim_putchar and sim_putchar_s (sim_console.c) to test not only that the match string starts at the start of the output buffer, but also that the string lengths are equal. STATUS: Local patch created 2011-12-22. 4. ENHANCEMENT: The ASSERT command now requires a conditional operator. VERSION: 3.3-1 OBSERVATION: 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" to require a conditional operator. STATUS: Local patch created 2005-03-13. 5. ENHANCEMENT: The meaining of the -E switch to "do_cmd" is reversed. VERSION: 3.6-0 OBSERVATION: The DO command normally continues in the presence of errors returned by the command invocations. The -E switch was added in revision 3.6-1 to alter behavior to abort on any error. This patch reverses the sense of the -E switch. Specificing -E now allows command execution to continue in the presence of errors; the default is to abort on the first error encountered. RESOLUTION: Modify "do_cmd" (scp.c) to reverse the sense of the -E switch. STATUS: Local patch created 2006-06-08. 6. PROBLEM: Detach of unattached unit succeeds without warning. VERSION: 3.6-1 OBSERVATION: Currently, detaching a unit that is not attached succeeds quietly. It would be helpful if it printed a warning ("Unit not attached") for this condition. RESOLUTION: Modify "detach_unit" (scp.c) to return SCPE_UNATT if the unit is not attached, except when restoring a saved session. Note that the RESTORE command unconditionally calls "scp_detach_unit" if a unit is to be attached as part of the restoration. Returning SCPE_UNATT would terminate the restoration, so this case is detected, and SCPE_OK is returned unconditionally. STATUS: Local patch created 2006-08-30. 7. PROBLEM: The patch delta report isn't obvious. VERSION: 3.8-0 OBSERVATION: A patch delta was added to the printed version string. But the form chosen -- a number in parentheses -- isn't obvious as to its meaning. RESOLUTION: Modify "show_version" (scp.c) to label the delta number explicitly. STATUS: Local patch created 2008-06-04. 8. PROBLEM: ATTACH -R and ATTACH -N commands are too noisy. VERSION: 3.9-0 OBSERVATION: The ATTACH command prints informative messages when it creates a new file, opens a read-only file, or buffers a file to memory. These messages are useful indicators for the plain ATTACH command to indicate that something unexpected may have occurred. However, when explicitly requesting a read-only (-R) or new file (-N) attachment, messages that restate the request are redundant. Moreover, with scripted attachments, they can disrupt program output by intruding between logged prompts and responses. These messages are suppressed when SIMH is started with the -Q (quiet) option, but that option also suppresses messages from DO commands, which may be undesirable. CAUSE: Message printing does not take into account whether the request was explicit. RESOLUTION: Modify "attach_unit" (scp.c) to suppress informative messages if the ATTACH command explicitly specifies the "-R" or "-N" options. STATUS: Local patch created 2014-11-10. 9. ENHANCEMENT: Add a SET CPU BIN command and a -B (binary) format EX/DEP switch. VERSION: 3.9-0 OBSERVATION: RESOLUTION: STATUS: Local patch created 2017-09-01. 10. ENHANCEMENT: Add IF, GO UNTIL, REPLY, and DELETE commands, along with built-in variables and substitutions, including environment substitutions. VERSION: 3.9-0 OBSERVATION: ...IF permits -I for case-insensitive comparisons. RESOLUTION: STATUS: Local patch created 2017-05-20. 11. PROBLEM: A semicolon within a quoted string terminates an action command. VERSION: 3.9-0 OBSERVATION: The GO UNTIL command permits a semicolon-separated list of commands as the breakpoint action. However, if one of the action commands contains a semicolon within a quoted string, the command will be broken at that point. For example, this command: go until "\r\n:" ; reply "BUILD COMMAND;REC=20,32;DISC=500\r" ...will attempt to execute: reply "BUILD COMMAND ...when the breakpoint is hit, which fails with an "Invalid argument" error. CAUSE: The GO UNTIL command uses the "sim_brk_getact" routine to process the action list when the breakpoint is hit. This routine searches the action list for a semicolon without regard to context. Semicolons within quoted strings should not be recognized as command separators. RESOLUTION: Modify "sim_brk_getact" (scp.c) to skip over a quoted string when looking for a semicolon as a command separator. STATUS: Local patch created 2018-02-20. 12. PROBLEM: Action commands may be grouped with the wrong actor. VERSION: 3.99-0 OBSERVATION: The IF, BREAK, and GO UNTIL commands each accept a list of action commands to be performed if the condition is true or when the breakpoint occurs. If one of the action commands is itself one of these three, the actions may not be grouped with the correct actor. Consider: IF "1" == "1" BREAK 100 ; EXAMINE A The EXAMINE command could be associated either with the BREAK command or the IF command. Currently, it will be executed with the latter, i.e., immediately when the command is entered. The output is: sim> BREAK 100 sim> EXAMINE A A: 000000 There is no way to perform the EXAMINE as the breakpoint action. Similarly, the command: IF "1" == "1" GO UNTIL "READY?" ; REPLY "YES\r" ...will not reply to the prompt. Indeed, the reply is never executed, as the GO command clears any pending actions. Another problem is that commands containing semicolons as parameter separators cannot be used as breakpoint actions. For example, this command: BREAK 100 ; SET CPU DEBUG=INSTR;DATA ...will fail when "DATA" is executed asa the second action. CAUSE: The search for command separators in the "sim_brk_getact" routine is not context-sensitive. Action command lists should be associated with the nearest IF, BREAK, and GO UNTIL command, but instead they are associated with the first one encountered. RESOLUTION: Modify "sim_brk_getact" (scp.c) to accept an action command list enclosed by quotes as a single command. Using the above examples, the addition of surrounding quotes: IF "1" == "1" "BREAK 100 ; EXAMINE A" IF "1" == "1" 'GO UNTIL "READY?" ; REPLY "YES\r"' BREAK 100 ; 'SET CPU DEBUG=INSTR;DATA' ...causes EXAMINE to be the action command for BREAK and REPLY to be the action command for GO UNTIL, instead of both being the (second) action command for IF, and causes the INSTR and DATA debug flags to be set, instead of failing with an "Unknown command" error. This is consistent with 4.x behavior. STATUS: Local patch created 2018-02-20. 13. ENHANCEMENT: Write ECHO command output to the OutputDebugString function. VERSION: 3.99-0 OBSERVATION: It is desirable to have a simple mechanism to time sections of simulated execution. For example, it might be desired to determine how much execution time a new algorithm saves over a previous one. A way of timing that section to a reasonably high resolution would be helpful. Rather than creating a new command that calls a high-resolution timer, derives a delta from the prior call, and outputs that to the console, it would be simpler to leverage the timing facility of the System Internals "DbgView" program, which captures the output of the OutputDebugString function of the Win32 API. RESOLUTION: Modify "echo_cmd" (scp.c) to write the ECHO command's string parameter to the OutputDebugString function when a new "sim_debug_echo" variable is TRUE. Modify "sim_set_debon" and "sim_set_deboff" (sim_console.c) to set and clear this variable in response to SET DEBUG (with no filename specified) and SET NODEBUG commands. STATUS: Local patch created 2018-03-29. 14. ENHANCEMENT: Add SET ENVIRONMENT. VERSION: 3.99-0 OBSERVATION: RESOLUTION: STATUS: Local patch created 2018-04-09. ——————————————————————————————————————————————————————————————————————————————— xxx. PROBLEM: VERSION: 3.99-0 OBSERVATION: CAUSE: RESOLUTION: STATUS: Local patch created xxx. ENHANCEMENT: VERSION: 3.99-0 OBSERVATION: RESOLUTION: STATUS: Local patch created