UsingTheTypewriter - pkimpel/retro-1620 GitHub Wiki

Using the Typewriter

The typewriter device used with the 1620 was a modified IBM 731 Selectric. It printed at a maximum rate of 15.5 characters/second and had a maximum carriage width of 85 columns. The typewriter could not be used off line. Unless the 1620 issued a read command to the typewriter, the keyboard was locked. The SPACE, TAB, and RETURN keys, however, could always be used locally to reposition the typeball and advance the paper.

The retro-1620 emulator attempts to reproduce the functionality of the typewriter and the appearance of its output. In the emulator, the typewriter has its own window and looks like this:

retro-1620 Typewriter

The window can be moved to any position on the screen and resized both horizontally and vertically. The window can be minimized, but closing the window will render the typewriter unusable until the emulator is restarted.

Whenever the typewriter is selected for either input or output, the TWPR SELECTED lamp on the Control Panel will be lit. This lamp will go out when the input or output operation to the typewriter terminates.

Output to the Typewriter

The large white area of the window represents the "paper" in the typewriter. It will grow or shrink in response to the window being resized, and will scroll once the amount of output vertically exceeds the visible paper area. The maximum capacity of the paper is 10,000 lines – approximately 1700 pages and 10 hours of printing. When the amount of scrolled output exceeds this limit, the oldest lines in the scroll buffer will be discarded.

Flag bits are printed as a bar over the flagged digit. Flag bits are printed only in numeric input and output – the Dump Numerically (DN, 35), Read Numerically (RN, 36), and Write Numerically (WN, 38) instructions.

Output to the typewriter for Write Numerically (WN, 38) and Write Alphanumerically (WA, 39) instructions terminates when a "Record Mark-like" character is encountered in memory. This terminating character is not printed. A "Record Mark-like" character is one having its 8 and 2 bits set, which includes the Record Mark (hex A), Group Mark (hex F), and the hexadecimal digit values B and E. For alphanumeric output, this terminating code is recognized only in the "numeric" digit of the character's digit pair, i.e., the digit at the odd address.

Below the paper area are text boxes to configure the typewriter. Those on the bottom-left set margins:

  • The value in the Margin Left box determines the number of positions by which typing is indented on the left.
  • The value in the Right box determines the last printing position on the line. Attempting to print beyond the right margin causes an automatic carriage-return.
  • The left margin must be less than the right margin and not less than zero.
  • The right margin must be 85 or less.
  • The difference between the right and left margins is the maximum number of characters that can be printed on a line.

The Tab Stops box on the bottom-right contains a comma-delimited list of 1-relative tab stops, i.e., a tab stop set at 9 will have eight print positions to the left of it; a stop at 57 will have 56 print positions to the left of it.

  • By default, tab stops are set at every eight positions.
  • The list of tab stops must be specified in ascending order and must be separated by commas.
  • The commas may be surrounded by spaces. Empty fields between commas are ignored.
  • Tab stops are relative to the first printing position of the paper area; they are not affected by changes to the left margin.

To change any of these configuration settings, simply click in or tab into one of the boxes and change the text. Clicking or tabbing out of the box will set that value. These settings are preserved across browser restarts.

The INSERT button to the right of the margin text boxes performs the same function as the INSERT button on the Control Panel.

The IBM Selectric logo at the bottom center of the window can be used to print the contents of the paper area, as discussed below under "Capturing Typewriter Output."

Input from the Typewriter

When the typewriter is enabled for input, you use your workstation keyboard to enter the data. In order for your keystrokes to be sent to the typewriter, however, its window must have "the focus," i.e., it must be the currently selected window on the screen. If some other emulator window has the focus, the keystrokes will be sent to it, and probably ignored.

There are three ways that the typewriter can be enabled for input:

  1. The program running in the 1620 executes a Read Numerically (RN, 36) or Read Alphanumerically (RA, 37) instruction that selects the typewriter using device code 01.
  2. Pressing the INSERT button on the Control Panel or Typewriter windows. This button is effective only when the system is in the MANUAL mode. Pressing this button automatically sets up a Read Numerically instruction in the CPU, sets the IR-1 and OR-2 registers to zero, and places the system in AUTOMATIC mode. The values of numeric keystrokes are stored in memory starting at address zero, and the OR-2 register increments by one for each digit entered.
  3. Pressing the Esc key on your keyboard. This method works only when the Typewriter window has the focus, and is also effective only when the system is in the MANUAL mode.

Input from the typewriter is terminated in one of three ways:

  1. By pressing the RELEASE button on the Control Panel. This disables the typewriter for input and places the system in the MANUAL mode. The START button on the Control Panel can be pressed to continue execution at the address currently in register IR-1.
  2. By pressing the R/S (Release/Start, #) key on the typewriter. This is equivalent to pressing the RELEASE followed by the START buttons on the Control Panel, except that the typewriter also prints a special symbol on the paper. In the emulator this special symbol is represented by §.
  3. If the typewriter has been enabled for input using the INSERT button, then after 100 digits have been entered and the final digit is stored at address 99. At that point, the typewriter behaves as if the RELEASE button had been pressed, and the system is placed in the MANUAL mode. This is done to prevent accidentally overwriting the multiplication tables at 00100-00399. To enter more than 100 digits into memory, use the INSERT button to enter a Read Numerically instruction, e.g., 360000000100.

While the typewriter is enabled for input, the paper area will show a red border. A real typewriter made some mechanical noise when it was enabled, which confirmed to the operator that the typewriter was ready for input. The red border is the emulator's analog for that behavior. This border disappears when the release occurs.

The emulator attempts to give the Typewriter window the focus when it is enabled, but this does not work in Google Chrome and possibly some other browsers. If the window does not receive the focus automatically, you must manually activate it by clicking somewhere within the window or tabbing to it.

As keystrokes are sent to the typewriter window, the system will process them. If the keystrokes are valid for typewriter input, they will be echoed to the paper. Invalid keystrokes will cause the cursor on the paper (_) to flash momentarily.

The following keys are valid for input when the typewriter is enabled for numeric input:

Key Function
0-9 stores 0-9, respectively
Space stores 0
@ stores the numeric-blank code, hexadecimal C
` or ~ FLG key, which echoes as an over-line. The next digit, @, or | entered will be echoed under the over-line to indicated it is flagged, and the corresponding code will be stored in memory with its flag bit set
Backspace CORR key, which echoes as a mid-line bar on the paper. The memory address in OR-1 where the next digit will be stored is decremented by one for each press of this key, effectively erasing the prior key entered
| Record Mark, stores hexadecimal A, echoes as . This is typically used to mark the end of the input in memory
} Group Mark, stores hexadecimal F, echoes as &#x\u2262;. This is typically used only to mark the end of a record area for disk I/O
# R/S key, which echoes as § and acts as if RELEASE and START had been pressed

The following keys are valid for input when the typewriter is enabled for alphanumeric input:

Key Function
A-Z stores 41-69, respectively, codes for A-Z. Lower-case letters are converted to upper-case
0-9 stores 70-79, respectively, codes for 0-9
Space stores 00, the space code
. stores 03, the period code
, stores 23, the comma code
$ stores 13, the dollar-sign code
@ stores 34, the at-sign code
+ stores 10, the plus-sign code
- stores 20, the hyphen code
* stores 14, the asterisk code
/ stores 21, the forward-slash code
= stores 33, the equal-sign code
( stores 24, the left-parenthesis code
) stores 04, the right-parenthesis code
` or ~ FLG keys are ignored in alphanumeric input
Backspace CORR key, which echoes as a mid-line bar. The memory address in OR-1 where the next digit will be stored is decremented by two for each press of this key
| stores hexadecimal 0A, the alphanumeric Record Mark code and echoes as
} stores hexadecimal 0F, the alphanumeric Group Mark code and echoes as &#x\u2262;
# R/S key, which echoes as § and acts as if RELEASE and START had been pressed

Note that for both numeric and alphanumeric typewriter input, no Record Mark is stored in memory automatically. You must use the | key to enter one into memory if needed.

Capturing Typewriter Output

To capture the output from the typewriter paper area and preserve it after the emulator is powered off, click the three-bar ("hamburger") menu icon in the upper-right of the paper area. This will open a small panel on top of that icon with additional options:

1620 Typewriter Menu

Extract – Opens a temporary window and copies the contents of the paper area to that window. From that temporary window you can save the contents of the window to a file or copy/paste the data into another program. If you save directly from the window, make sure you save as text, not HTML. When you are finished, simply close the temporary window.

Print – Opens a standard print dialog to print the contents of the paper area to a local device. Most modern browsers will also have an option to print to a PDF file.

Save – Opens a standard save-file dialog to save the contents of the paper area as a text file on your local system. The dialog provides a default name, which you can change before saving. If your browser saves the file without opening a dialog, check your browser settings – there should be an option to select how downloads are to be saved.

Clear – Clears the paper area and closes the panel.

Close – Simply closes the panel.

When using the Extract and Save options, the character glyphs in the paper area are converted to plain ASCII glyphs as follows. These conventions are based on those used by the Computer History Museum IBM 1620 Jr. project:

Glyph Converted to
(Record Mark) |
(Group Mark) }
§ (R/S key) #
Flagged 0 ]
Flagged 1-9 lower-case j through r, respectively
Flagged numeric blank (@) ~
Flagged Record Mark !
Flagged Group Mark "
(all invalid codes) ?
All others themselves

The former methods of capturing the paper area – double-clicking the paper area and clicking the Selectric logo – are no longer implemented.

⚠️ **GitHub.com Fallback** ⚠️