The simulator configuration is controlled by the "rc" file "~/.wang600.rc". This file is normally configured through the "Edit"/"Preferences" menu items, but may also be editted manually if necessary (beware of mispelling paramters). The following parameters on the "Preferences" window control certain aspects of the calculator. The corresponding parameter names in the rc file are listed in square brackets.
The simulator is normally started with the following command:
java -jar wang600.jar
which starts up the simulator in normal mode.
The special "Mark-Sense Card Editor" program is also included in the jar file. It may be started with the command:
java -cp wang600.jar w600_edit
The installable packages contain helper commands that execute the above java commands. For the calculator, that is exposed as a desktop icon to click.
An alternative is to run the simulator with debugging enabled.
java -jar wang600.jar -i
Or the option "-I" (capital "I") causes the program to stop in the debug console before the calculator is initialized. Type the command "go" to start the calulator (other commands allow tracing, setting break points, etc).
Typing Ctrl-D in the calculator window will pause the simulation and print a command prompt. The command "help" will display available debug commands.
In order to use the debugging console, the simulator must have been started from a "terminal window" that is still active (all debug interaction will take place there, i.e. using stdin/out). Note, desktop icons often do not retain a terminal window after starting the program.
Because the simulator runs real microcode from an actual Wang 600, it should behave identically to the original. However, some practicalities as well as possible oversights in hardware simulation may result in subtle differences. See the section on "Simulator Internals", below, for more information.
One notable difference in in "keyboard locking". There were situations (mainly I/O commands) where the calculator keyboard (with the exception of PRIME and debug keys) were disabled. This is not currently implemented, which means it is possible to interfere with certain operations (again, typically I/O) by pressing calculator keys during those operations.
Also, operation of the peripherals is based on incomplete documentation (not all peripheral schematics are available, little-to-no example software remains, and very few operators manuals have been found). The best effort has been made to emulate these peripherals accurately. Anyone with knowledge (or resources) related to Wang peripherals is encouraged to contact me.
In addition, the following keyboard shortcuts are supported:
Key | Meaning |
---|---|
0-9 | E0-E9 |
. | E10 (decimal point) |
e E | E11 (SET EXP) |
– | E12 (CHANGE SIGN) |
Backspace | E15 (CLEAR DISP) |
t T | T xx |
s S | ST xx |
r R | RE xx |
x X | EX xx |
+ | + xx |
_ (underscore) | – xx |
* | × xx |
/ | ÷ xx |
i I | INDIR |
← | default register (xx) –1 |
→ | default register (xx) +1 |
When switching the default register, the current default register will be highlighted gray. Initially, the default register is 15 (LEFT) and will not be highlighted.
By default, the display uses a TrueType font designed from the Panaplex 9-segment display array used in the Wang 600. The font is named "Panaplex9seg.ttf". An alternate font, "NixieZM1336.ttf", is also present which is a facsimily of the ZM1336 Nixie tubes used in the Wang 500 and Wang 700 Series.
These fonts provide the characters '0' - '9' and 'A' - 'F' which authentically replicate the standard decoding of the 7445 (Panaplex) or 7442 (Nixie) TTL I.C. They also provide '+', '–', '.', and ' ' (space) which replicate specific features of the displays used by Wang.
The Panaplex font also provides a character at '\005' which represents the digit '1' using the 8th and 9th segment of the display, which is authentic to the Wang 600 hardware which overrides the 7445 decoder in that case.
Both fonts also provide a "zero width" right-hand decimal point at '\007' that is not used by the Wang 600 but provided for compatability with the Wang 700 (and other Nixie tube based devices). It is a way to turn on the decimal point of a digit without requiring a separate column position in the display. This decimal point is for the previous digit, i.e. it is placed to the left of, and outside the character cell of, the next digit. This is actually the expected behavior, for example if the the string "1.4" has the '.' replaced with '\007' then it would still display the number "1.4" but with the decimal point immediately to the right of, and inside the character cell of, the '1' digit and this string would consume only 2 columns on the display.
These fonts also provide an "optimized" decimal point at character location '\006', centered in the character cell above the baseline, which is not authentic but provides a better looking display when an entire column is consumed for the decimal point.
In additon, the fonts provide a half-space character at '\004', which is used to represent a half-width gap between display elements on devices that mounted the display with, for example, a gap between mantissa and exponent.
Program image files are by default stored in the user's home directory in a folder named "Wang600Files". The environment variable WANG600HOME may be used to select a different path.
Files are organized by suffix. Currently, all program image files have the .w6t suffix (for Wang 600 Tape images). All .w6t files are raw binary program codes and registers, with a program record ending in two END PROG codes (0x9e 0x9e), and a register image (ALPHA STORE) ending with 0x9e 0xff. Expansion ROM images have the suffix .w6x. Model 630 Disk images have the suffix .w6d.
The tape drive uses files on the local system. These files have raw binary program codes only. The files may have multiple program images, each terminated by an END PROG code, but the preferred method of operation is to put only one program image in a file.
In order to LOAD PROG or RECORD PROG, the tape unit must be "Ready", by depressing the "Tape Ready" button. If these operations are attempted when the Tape Ready button is not depressed, the display will blank. Pressing PRIME will restore normal operations.
The "Release" (tape eject) button will pop-up a file-selection dialog to allow choosing a file to use as a tape image.
The "Forward" and "Rewind" buttons will move the current location
inside a file to the next, or previous, program image. Since most files
will have only one program image, these are not normally used.
Printer Operation
Like the original hardware, the printer must be "On" in order to print. In Run mode, attempts to print (or List Program, etc) will hang with a blank display (just like the original hardware) until either the printer is turned on or PRIME is pressed. Programs that attempt to print will simply stop without printing anything.
Since there is no physical printer, the printed output is put in a window where it may be viewed. In addition, this window allows Copy operations (e.g. Cut-n-Paste) to extract the contents (or a portion of it). In addition, a menu option "Save" may be used to save the current contents to a file. A menu option "Tear Off" will clear the print window and discard all current contents. The window is only visible when the printer is "On", and if the window is closed then the printer is turned off. The contents of the window is not removed when the printer is off.
The menu option "Print" will send the re-formatted output to the
default printer. The "paper strip" will be formatted on a landscape page
in four columns of 40 lines each, per page.
Expansion ROM
The expansion ROMs are handled as files, similar to the Tape unit.
Selecting the ROM item from the "Devices" menu will pop-up a file
selection dialog, the chosen file will be downloaded to the simulator
and placed in the ROM memory. Up to 2048 steps may be loaded.
The file is formatted like other program images, the first byte is
loaded into the highest address, the next is loaded into the next lower
address, etc.
601 OutputWriter
This peripheral was based on a modified IBM Selectric typewriter.
It is capable of text output only, with standard spacing.
The device is "connected" through the "Devices"/"Output Device..." sub-menu.
Printing to this device causes the "output window" to become visible.
Selecting the device (when already connected) from the "Output Device..." sub-menu also makes it visible.
The output may be consumed in the same way as for the built-in printer,
from the "File" menu (Saved, Printed, or Tear Off).
There is also a "Typewriter" menu will eventually provide setup of paper size, margins, etc.
602 Plotting OutputWriter
This peripheral was based on a modified IBM Selectric typewriter.
It is capable of text output along with micro-spacing which allows plotting.
The device is "connected" through the "Devices"/"Output Device..." sub-menu.
Printing to this device causes the "output window" to become visible.
Selecting the device (when already connected) from the "Output Device..." sub-menu also makes it visible.
The output may be consumed in the same way as for the built-in printer,
from the "File" menu (Saved, Printed, or Tear Off).
There is also a "Typewriter" menu that provides a "Home" function for
the carriage, and will eventually provide setup of paper size, margins, etc.
611 Input/OutputWriter
Group I/O Commands | |
---|---|
Code | Effects |
GROUP 2 04 12 | Type in Run Mode |
GROUP 2 04 13 | Enter in Learn Mode |
This peripheral was based on a modified IBM Selectric typewriter. It is capable of text output as well as input from the keyboard. The device is "connected" through the "Devices"/"Output Device..." sub-menu. Printing to this device causes the "output window" to become visible. Selecting the device (when already connected) from the "Output Device..." sub-menu also makes it visible. The output may be consumed in the same way as for the built-in printer, from the "File" menu (Saved, Printed, or Tear Off). There is also a "Typewriter" menu will eventually provide setup of paper size, margins, etc.
In addition to the "paper view" window there is a control panel that indicates and controls the input modes. Clicking the I/O LOCAL switch will toggle between those two modes. In LOCAL mode the page may be typed directly without sending anything to the calculator. Unlike the real hardware, the calculator is allowed to run normally in LOCAL mode. I/O mode is when the device is under full control of the calulator.
The calculator command Group 2 04 12 places the device in the "input mode", where the calulator is forced into LEARN mode and characters typed in the device window are stored in the program memory of the calculator. Typically, a sequence of characters are preceded by the ALPHA code and ended with an END ALPHA code. Press the GO button to end input mode.
The calculator command Group 2 04 13 places the device in the "type mode", where characters typed in the devuice window are printed but not sent to the calculator.
The calculator remains in the RUN mode, but is waiting for the GO command from the device
in order to be released.
612 Flatbed Plotter
This device is capable of vector (line) plotting as well as (drawn) text from a limited
character set.
The device is "connected" through the "Devices"/"Output Device..." sub-menu.
Plotting to this device causes the "output window" to become visible.
Selecting the device (when already connected) from the "Output Device..." sub-menu also makes it visible.
The output may be consumed in the same way as for the built-in printer,
from the "File" menu (Saved, Printed, or Tear Off).
There is also a "Plotter" menu that allows setting the plot area, pen color,
and returning the plot carriage to the "home" position.
Future enhancements will include control over the paper size.
External Storage (Random Access I/O)
Devices that use the I/O command to transfer data must also
be selected (enabled) ahead of time using a GROUP I/O command sequence.
Each device has a unique set of values, one of which must be used as
the second step of a GROUP 1 or GROUP 2 command, depending on the device
and configuration. The device answers the GROUP I/O command immediately with
a GO command, but retains selection of the hardware until another GROUP I/O
command is executed. Once selected, a device will respond to I/O 13-xx commands,
otherwise it ignores them.
608/618 Extended Memory
GROUP 2 00-xx where "xx" is the value configured by the switches on the device. Rather than actually support multiple, separate, devices, the simulator implements all 16 possible devices, with each device configured for 0 to 4K of memory, in 1K chunks.
Model 608 employed core memory with unknown configuration options.
Model 618 employed up to 4 banks of 1Kx1 MOS dynamic RAM chips (8 chips per 1K bank).
630 Fixed/Removable Disk
This device is simulated by a single file that supports the entire
16M address range of the device protocol. So there is not a separate removable
disk, but simply a single image that may be read/written as a whole.
Selecting the "630 Disk" option from the "Devices" menu will pop-up
a file selection dialog from which a image may be selected to use as
the disk. The file will be expanded as needed by writes. The file may
also be "sparse", if writes are made beyond the current end of file.
Unwritten portions of the file will read back as zero.
603 Paper Tape Reader
Group I/O Commands | |
---|---|
Code | Effects |
GROUP 1 00 00 | Read number in Run Mode |
GROUP 1 00 07 | Skip to CR/LF (no data entry) |
End Of Tape is signaled by S&R 00 and GO |
This device is referred to in Wang documentation as the "Paper Tape Editor". It can extract numeric data from "standard" 8-level ASCII paper tapes. The original device apparently was capable of printing the paper tape contents on an OutputWriter, however details of that are not known and that feature is not (currently) emulated.
File images used with this device are either "Text" (.txt) or "Wang Data File" (.wdf). The simplest form is one number per line with no other text.
Invoking GROUP 1 00 00 will cause one numeric value to be scanned from tape. non-numeric characters are skipped, then the numeric entry codes are sent until a non-numeric code is encountered. Note, scientific notation was apparently not supported, and is not emulated.
Invoking GROUP 1 00 07 will cause the device to skip all characters until a Carriage Return is seen. The emulation looks for the Unix end-of-line character (line feed).
Also, it was not clear from the brochure exactly how "End Of Tape" was handle.
This emulation sends both "f(0)" and "GO" on end of tape, as that seems to be required
if the tape is being handled entirely under program control (because the calculator was
essentially stopped while waiting for the Group I/O operation,
the f(0) would RETURN to the stopped state and the program would not continue
without the GO).
605 Micro Face
Group I/O Commands | |
---|---|
Code | Effects |
GROUP 1 07 xx | Enter number from device 'xx' in Run Mode |
This device was a general-purpose electronic interface to any hardware that could generate BCD data, enabling real-time sampling of external data. It was limited to a maximum of 7 digits plus sign bit, and less if a decimal point was added somewhere. It supported scientific notation only as far as the program could decode certain digits as exponent (the device was not capable of using the SET EXP function of the calculator). Up to 16 devices were supported, allowing for sampling of 16 different data points.
Invoking GROUP 1 07 xx will cause external device 'xx' (00-15) to be activated and one sample read. The emulation has no "TTL fan-out" limitations, so the number of devices is not limited to 10. For the purposes of emulation, an "external device" is any arbitrary command to be executed on the native computer. The command must produce a single numeric value on it's stdout, although the emulation does not limit that to 7 digits. It is recommended that the sign be appended to the string, for example "55-" to represent negative fifty five. This is the way the original hardware presented the numeric value to the calculator, and avoids problems with the CHANGE SIGN code sometimes affecting the previous number, not the next one being entered. An alternative is to always code a CLEAR X before the GROUP 1 command.
Several example "devices" are present by default, and attempts are made to provide equivalents on Windows (CYGWIN is preferred). These default commands are:
Device | Unix command | Number returned |
---|---|---|
07 12 | date +%s | Seconds since "epoch" |
07 13 | echo $RANDOM | A pseudo-random number 0-32767 |
07 14 | date +%H%M%S | current time, HHMMSS |
07 15 | date +%m%d%y | current date, MMDDYY |
"Devices" (commands) are setup through the "605 Micro Face" item in the "Devices" menu.
606/607 Teletype
Group I/O Commands | |
---|---|
Code | Effects |
GROUP 1 15 00 | Start Tape (X ON) and enter number in Run Mode |
GROUP 1 15 01 | Print "1" and enter number in Run Mode |
GROUP 1 15 02 | Print "2" and enter number in Run Mode |
GROUP 1 15 03 | Print "3" and enter number in Run Mode |
GROUP 1 15 04 | Print "4" and enter number in Run Mode |
GROUP 1 15 05-15 | Enter number in Run Mode |
GROUP 2 15 00 | Start Tape (X ON) and enter characters in Learn Mode (tape must contain WRITE ALPHA codes, etc.) |
GROUP 2 15 01 | Print "1" and enter characters in Learn Mode |
GROUP 2 15 02 | Print "2" and enter characters in Learn Mode |
GROUP 2 15 03 | Print "3" and enter characters in Learn Mode |
GROUP 2 15 04 | Print "4" and enter characters in Learn Mode |
GROUP 2 15 05-15 | Enter characters in Learn Mode |
Run Mode emits X OFF (Stop Tape) when exiting commands |
This peripheral consisted of Model 607 components that provided an ASCII/TTY/Remote interface to the calculator and an unmodified ASR33 Teletype designated Model 606. The emulation provides the Model 607 functionality (with additions described below) and the Model 606 functionality is provided by a simple socket/port text client such as "telnet".
An ASR33 Teletype integrated the keyboard, print unit, paper tape punch, and paper tape reader. This emulation places the paper tape functionality in with the Model 607 code and leaves the keyboard and print unit to the chosen client. If a client supports session logging and playback, then the paper tape functionality in the Model 607 might be redundant. But since most "telnet" clients, and simple I/O through a socket, do not support such features this functionality is kept in with the Model 607 code.
The client connects to the Model 607 using the host configured (default is the localhost IP 127.0.0.1) using port 10607. The Model 607 must be "installed" (using the "Devices" -> "Output Device..." menu) in order for a client connection to succeed. Although the Model 607 hardware supported more than one Model 606, this emulation does not (currently) support multiple clients connected at the same time. Note, such support would require a change to paper tape handling, as each client would expect independent control of their own paper tape "hardware".
If using "telnet" as a client, the user should turn off "LINEMODE". This is typically done by entering command mode using the assign client escape character (often Ctrl-]), and entering the command "mode character". This mode is also known as "character-by-character" mode and includes having the server (Model 607) perform the "echo" functionality. The emulation does not currently assume a client is "telnet" and so does not attempt to force this configuration. most telent clients support some sort of "telnetrc" file, which may be used to set "mode character", however that would force character mode for all connections to that host by telnet, not just connections to the Model 607 (since telnet is rarely used anymore for "login connections", this may not be a problem).
The paper tape functions are controlled through the "Devices" -> "607 Teletye..." sub-menu, which is only enabled while a client is connected. This better emulates the true hardware locality of the ASR33 Teletype. A file image for the paper tape reader may be selected, and the paper tape punch image may be saved or torn-off (and discarded). There is always a file available to the punch, it is named "607Punch.txt". "Saving" consists of renaming that file and creating a new, empty, punch image. This file will be truncated (empty) whenever the "Tear Off" or "Save" options are used (with the exception of "Canceling a Save" does not alter the punch image).
Teletype-Wang character conversions are documented in the
607 Character Conversion Table.
614 Mark-Sense Card Reader
Group I/O Commands | |
---|---|
Code | Effects |
GROUP 1 04 08 | Read cards in Run Mode |
GROUP 2 04 08 | Read cards in Learn Mode |
While support for the actual card reader is pending, there is a novelty program that allows one to "edit" a program image in a similar way that a stack of mark-sense cards were edited. This is provided in the wang600.jar file, and may be run with the command "java -cp wang600.jar w600_edit", or the "edit" ("Wang614" on Windows) startup script in the package directory (typically HOME/wang600apc).
The original Wang 600 microcode was constantly executing instructions the entire time that the calculator was turned on. The simulator cannot afford to consume 100% CPU on the host system. One major area of consumption is the display refresh routines. To minimize system load, the refresh routines are "short cut" and long periods of refresh (stopped in Run mode, alpha-STOP when running a program, etc.) are converted into sleeps (waiting for a keyboard event, or sleep for a predetermined amount of time).
On the original calculator, the display was only visible during the time that the microcode was actually refreshing the display. All other times the display was blank, simply because it was not being refreshed. The simulator has a static display that does not go blank when refreshing stops. In order to better simulate the original hardware, specific places in the microcode have been identified and the display is explicitly blanked at those times. In addition, whenever a keyboard event takes place the display is blanked. It is possible, though, that there are places that have not been identified yet that the display would go blank on the original hardware but not in the simulator.
The simulator is capable of operating much faster than the original calculator. Because of this, there are subtle differences in the behavior of the display (for example) while running a program. Consider a program that uses alpha-STOP to display intermediate results. The calculations between two alpha-STOP's may take so little time on the simulator that the interleaving blanked display is not perceptible.
Peripherals are handled by the microcode, and as such will behave the same as the original calculator up to the point that the microcode hands off control to the simulator.
One example is the original tape drive, which simply recorded a stream of 0's and 1's onto the tape. The simulator must interpret those 0's and 1's and convert them back into 4-bit words of data. The simulator must also convert the 4-bits words back into signals, and timing, that the microcode expects to see when reading the tape. Also, the original microcode used 0.5-second gaps on the tape to indicate the end/beginning of a program (or registers) image. That is not practical when using files, so the gaps are represented with a pair of END PROG codes and the simulator must convert to/from the equivalent signals and timing for the microcode.
Another example is the built-in drum printer. The simulator must convert "drum position" and "column hammer" values into characters that can be displayed (and printed) on modern computers. Also, the drum printer had some highly-specialized glyphs (symbols) that can only be approximated using modern, standard character-set, fonts.