[Simh] Enhancement Request: Additional Built-In Variable

J. David Bryan jdbryan at acm.org
Thu Jan 10 19:56:38 EST 2019


On Thursday, January 10, 2019 at 18:56, Robert W.Mills wrote:

> Is it possible to have a built-in variable, possibly called something
> like %DATE_YY_DIF%, that holds the difference between %DATE_19XX_YY% and
> the actual year as held by the host operating system?

You can do this yourself with simulator commands:

  sim> set env -a DATE_YY_DIF=DATE_YYYY-1900-DATE_19XX_YY
  sim> echo %DATE_YY_DIF%
  28


> %DATE_YY_DIF% could then be used to translate dates from internal
> (simulator) to external (user) by adding the value to the internal
> year. 

As Paul pointed out, the tricky part is determining when a given set of 
output digits represents a year AND that year is supposed to be the current 
year (rather than actually referring to 1991, e.g.).  You wouldn't want a 
file that actually was modified last in 1991 -- say, from a backup tape 
image -- to be indicated that it was modified in 2019.  So I don't see any 
easy solution to this.


> David, is it possible to set a JCW with this value when a session
> starts?

Sure, you could add something like this:

  go until "LOGON FOR: OPERATOR.SYS,OPERATOR ON LDEV #20"
  go until "\r\n:" ; send "SETJCW DIFF=%DATE_YYYY%-19%DATE_19XX_YY%\r"

...just before the final "go" in your "mpe-auto.sim" startup file.  The 
first "go until" ensures that the second "go until" stops at the CI prompt 
and not when the system prints ":HELLO OPERATOR.SYS;HIPRI" as part of the 
automatic operator logon.

                                      -- Dave



More information about the Simh mailing list