# ASR 33 Teletype Help

The ASR 33 Teletype can operate under program control or independent of the PDP-8 unter manual control. When operated in manual mode, characters typed at the keyboard are printed by the type writer of the teletype. When additionally the paper tape punch is turned on, the typed characters are punched on the papter tape, too. When a paper tape is loaded into the reader and the reader is turned on, the teletype ignores the keyboard input and reads characters to print or punch from the reader paper tape.

When the teletype is used in online mode, characters typed at the keyboard or read from the reader paper tape are not printed or punched, but their ASCII value is transferred into the keyboard buffer register KBB, from where the PDP-8 can read it into the accumulator AC. The PDP-8 then can use teletype output IOTs to write the character to the teletype output buffer register TTO to initiate the printing or punching of the character.

The teletypes of the PDP-8/E Simulator have the following improvements compared to hardware ASR 33 Teletypes:

- Backspace handling: When the teletype is operated in local mode, typing the backspace key causes the last character to be removed from the output display and — when the punch is turned on — from the punch paper tape. The Macintosh clear key (at the top left of the numeric key pad or fn-6 on notebook keyboards) has the function of the ASR 33 rubout key.
- Tabulator handling: The teletype handles the output of tabulator characters with tabulator stops at every 8th column. (Tab characters are punched to paper tapes unaltered.)
- Speed: The simulated teletype can run with the speed of a hardware ASR 33 teletype (about ten characters per second) or as fast as possible. Use the ASR 33 preference pane to change the speed of the teletype.
- High bit masking for the punch: When this feature is enabled (in the ASR 33 preference pane), the paper tape punch masks the most significant bit of the punched characters. This is useful when you run PDP-8 software that use the 8th bit as a checksum and save the output to a paper tape. When the MSB is masked out, you can open and read the paper tape file with any Mac text editor. (When punching BIN or RIM format paper tapes, you normally won't have to disable the MSB masking because these formats use the 8th bit only for punching leaders or trailers, which are not needed with paper tapes stored in files. One exception: BIN format with field settings uses values 3x0 (x=0,…,7) to signal that the following code is to be loaded to memory field x.)
- “Copy & Paste” and “Drag & Drop” is supported for the teletype: When you paste text into the teletype window, the text is inserted into a typeahead buffer from where the teletype reads it sccessively as if the characters were typed at the keyboard. New keyboard input is appended at the end of the typeahead buffer. While the typeahead buffer is not empty, a button “Flush Typeahead Buffer” appears in the toolbar of the ASR 33 window that you can use to clear the buffer prematurely.

## Console Teletype

The console teletype uses I/O address 03 for the keyboard and reader and 04 for the printer and punch and supports the following IOTs:

Mnemonic Symbol | Octal Code | Description
--- | --- | ---
KCF | 6030 | Clear the keyboard/reader I/O flag (“Console TTY In” in the CPU window). Do not start the reader to read the next tape character.
KSF | 6031 | Skip the next instruction when the keyboard/reader I/O flag is raised, i. e. a new character is loaded into the keyboard buffer register KBB.
KCC | 6032 | Clear AC and the keyboard/reader I/O flag. When the paper tape reader is turned on, start to read the next character from the tape. When a new value is loaded into KBB (from the tape or — when the reader is turned off — because the user typed a key), the flag is raised again.
KRS | 6034 | Transfer KBB into AC(4–11) by performing a logical OR (“static” read).
KIE | 6035 | Load the keyboard/reader and printer/punch interrupt enable flag from AC(11) to enable or disable teletype interrupts.
KRB | 6036 | Clear AC and the keyboard/reader I/O flag, then read KBB into AC(4–11). Microprogrammed combination of KCC and KRS.
TFL | 6040 | Set the printer/punch I/O flag (“Console TTY Out” in the CPU window).
TSF | 6041 | Skip the next instruction when the printer/punch I/O flag is set.
TCF | 6042 | Clear the printer/punch I/O flag.
TPC | 6044 | Load the teletype output buffer register TTO with the contents of AC(4–11) and start to print and, when the punch is turned on, to punch the character from TTO. When the output is completed, the printer/punch I/O flag is raised.
TSK | 6045 | Skip the next instruction when an interrupt was caused by the teletype, i. e. when the interrupt mask flag for input or output and the corresponding I/O flag are both set.
TLS | 6046 | Clear the printer/punch I/O flag, load TTO from AC(4–11) and start the output. When the output is completed, the printer/punch I/O flag is raised again. Microprogrammed combination of TCF and TPC.

### Remark

Earlier PDP-8 models (PDP-8, -8/S, -8/I, -8/L) do not support the IOTs KCF (6030), KIE (6035), TFL (6040), and TSK (6045).

## Auxiliary Teletype

The PDP-8/E Simulator includes an Auxiliary Teletype that you can activate in the Finder information window for the PDP-8/E Simulator application in the area “Plug-ins”. (With Mac OS X 10.6 “Snow Leopard”, Apple has removed the Plug-ins section from the Finder information window, and you must open the application package manually and move the Auxiliary Teletype from the folder “Contents/PlugIns Disabled” to “Contents/PlugIns”.)

In the CPU window, the flags for the Auxiliary Teletype are called “Auxiliary TTY In” and “Auxiliary TTY Out”. It uses the I/O addressed 40 for input and 41 for output and supports the following IOTs:

Mnemonic Symbol | Octal Code | Corresponding Console Teletype IOT
--- | --- | ---
AKCF | 6400 | KCF (6030)
AKSF | 6401 | KSF (6031)
AKCC | 6402 | KCC (6032)
AKRS | 6404 | KRS (6034)
AKIE | 6405 | KIE (6035)
AKRB | 6406 | KRB (6036)
ATFL | 6410 | TFL (6040)
ATSF | 6411 | TSF (6041)
ATCF | 6412 | TCF (6042)
ATPC | 6414 | TPC (6044)
ATSK | 6415 | TSK (6045)
ATLS | 6416 | TLS (6046)

## Additional Teletypes

When you need additional teletypes, you can duplicate the Console or Auxiliary Teletype plugin and then modify the property list that describes the I/O addresses and IOTs for the plugin. You find this property list inside the plugin package at Contents/Resources/English.lproj/auxtty-io-info.plist.