UsingThePaperTapeReader - pkimpel/retro-1620 GitHub Wiki
The IBM 1621 was a paper tape reader unit used with the IBM 1620. The reader was housed in the same cabinet as the IBM 1624 paper tape punch, but the two were independent units. For information on the 1621, see the IBM 1621 Paper Tape Unit manual.
In the retro-1620 emulator, the paper tape reader and punch are implemented separately and each has its own window on the screen. This was done primarily to allow flexibility in positioning the windows for these units and making best use of available screen space. The paper tape reader is not in the emulator's default configuration, so you will need to select it by clicking the Configure System button on the main window of the emulator.
The window in the emulator for the paper-tape reader looks like this:
The 1621 could read 150 tape frames (characters) per second, and unlike some paper tape readers, could start and stop between individual frames. The reader used eight-channel tape. The holes punched in each frame were identified as follows:
E X 0 C 8 4 2 1
where E
is the EOL or end-of-record punch and C
("check") is a punch that maintains odd parity for the frame. Smaller sprocket-feed holes were present between the 8
and 4
punches. A special punch pattern, X0C8421, termed "tape-feed," is ignored by the reader during numeric and alphanumeric reads. Tape-feed frames are not transferred to memory. In retro-1620, frames with no punches (i.e., zero bytes) are invalid and will cause a RD CHK error when read.
To use the retro-1621 paper tape reader, you load tape image files into the reader's internal buffer, analogous to mounting a reel or strip of tape in a physical reader. You then execute Read Numerically (op code 36, Q8/Q9=03), Read Alphanumerically (op code 37, Q8/Q9=03), or Read Binary Paper Tape (op code 37, Q8/Q9=33) commands. Any unread data in the internal buffer is lost when the emulator is powered off.
Image files have two formats:
-
Binary โ tape frames are represented as eight-bit bytes with the
E
punch being the high-order bit and the1
punch being the low-order bit in the byte. This is typically the format used in image files produced by digitizing physical paper tapes. -
ASCII โ tape frames are represented as ASCII characters in a text file. This is a format developed for the retro-1620 emulator to make creation and editing of image files easier. A script exists to convert binary image files to this format.
Tapes can be read in three modes:
-
Numerically โ each tape frame is translated to a single digit and stored in memory. This mode is typically used for object code and numeric-only data.
-
Alphanumerically โ each tape frame is translated to a pair of digits and stored as an alphanumeric character at adjacent even/odd addresses in memory. This mode is typically used for source code and other textual data.
-
Binary โ each tape frame is translated to two octal (base-8) digits and stored into memory in a manner similar to alphanumeric characters. The X08 holes in a tape frame form an octal number that is stored at an even address; the 421 holes form a second octal number that is stored at the next odd address. Reading and generating binary tapes requires that the "Binary Capabilities" option be enabled in the emulator's configuration.
Tape image files loaded as either Binary or ASCII format can be read using any of the three modes, although some frames, depending upon the mode, may be interpreted as being invalid or having incorrect parity, e.g., reading an image intended for Binary mode using Alphanumeric mode.
The format of the image files is discussed in more detail under "Format of Paper Tape Image Files," below.
The window for the reader has controls to load tape image files and monitor the operation of the reader. The window can be resized and moved on your workstation display as desired. Resizing the window in the horizontal direction will adjust the width of its internal elements proportionately. Resizing the window vertically will simply change the height of the window and is not particularly useful.
The window has the following controls and displays:
Load As Text โ this check box determines the format from which image files will be loaded. The desired format must be set in the check box before a file is selected using the file-picker control, described next.
- If the box is ticked, files will be interpreted as having the ASCII format.
- If the box is not ticked, files will be interpreted as having the Binary format.
- The emulator always initializes with this check box not ticked.
Browse... or Select File... โ clicking this button will open a standard file-picker dialog to select tape image files for loading into the reader's internal buffer. You can select a single file or multiple files at a time, but when selecting multiple files, the order in which the files will be placed in the internal buffer varies by browser and operating system. If the order in which image files are to be read is important, you should load them one at a time. If multiple image files are selected in the file picker, all of them will be loaded as the format indicated by the check box above.
Additional files can be loaded at any time the reader does not have a read operation in progress. The button is disabled and grayed-out while a read is taking place. For most modern browsers, the practical limit for the amount of data that can be stored in the input buffer is at least multiple megabytes.
Binary-format image files are loaded into the internal buffer as is. Frames from ASCII-format image files are converted to Binary format in the buffer. Since all images have a common format in the buffer, you can load a mix of Binary and ASCII images into the buffer at the same time. Thus, the buffered tape frames can be read using any combination of the numeric, alphanumeric, or binary modes.
NON PROC RNOUT โ also referred to as "NPRO." On a real 1621, this switch was used to run out the tape in the reader's transport path without transmitting the frame data to the Processor. In the emulator, clicking this switch will clear the reader's internal buffer. The switch is active whenever the reader does not have a read operation in progress.
If the buffer has unread data, an alert will be displayed to confirm that you want to discard that data. The alert dialog is constrained to the boundaries of the window, so the emulator may temporarily resize the window vertically in order to see the whole dialog.
(Buffer Status) โ below the file picker-control is a meter bar that shows the relative amount of data left in the internal buffer. The height and styling of the meter varies by browser. The meter's indicator will be all the way to the right after loading one or more tape image files and moves to the left as frames are read from the buffer.
(Tape View) โ below the buffer-status meter bar is a white area that will show the frames most recently read from the buffer, as if you were watching the tape pass by. Characters enter the right side of the area, shift to the left as additional frames are read, and are discarded when they reach the left side. The last frame read is on the far right. This area is also cleared by the NON PROC RNOUT switch.
This display is useful to see where you are in the progress of reading, or to spot invalid characters if a frame has caused a read check and halted the reader. An EOL frame is shown as <
but is stored in memory as a Record Mark. Tape-feed frames are shown as an underscore, _
, but not stored by numeric or alphanumeric read operations. Frames that do not translate to an ASCII-equivalent character are shown as a middle-dot, ยท
.
The reader has no controls to start it, stop it, or make it ready. The reader is ready whenever one or more image files have been loaded into it and its internal buffer still has unread data. The reader goes not-ready once the last frame has been read from its internal buffer.
If the 1620 attempts to execute a paper-tape read operation when the reader's internal buffer is empty, the read operation will be suspended in the Processor and the READ INTERLOCK lamp on the Control Panel will light. The same thing will happen if the buffer becomes empty in the middle of a read operation. When this occurs, you have two options:
-
Press the RELEASE button on the Control Panel to cancel the read operation. This will halt the Processor, extinguish the READ INTERLOCK lamp, and turn on the MANUAL lamp. Pressing the START button will resume automatic operation at the instruction following the read instruction that was canceled.
-
Click the Browse... or Select Files... button on the reader's window to load one or more additional files into the internal buffer. Once additional frame data is loaded and the buffer is no longer empty, the read operation will automatically resume and the READ INTERLOCK lamp will go out.
Paper tape records can be of arbitrary length and are terminated only when an EOL frame is sensed. Some tape images, especially those used to load object code into the system, can have extremely long records that may take many minutes to read. To cancel the read operation for such a long record and stop and reader, simply press the RELEASE button on the Control Panel.
Binary tape image files are simply a byte stream. Valid bit patterns for reading numerically or alphanumerically are shown in this image from the IBM documentation:
The following codes not shown in the image above are also recognized by retro-1620:
Hole Pattern | Displayed as | Stored as | Notes |
---|---|---|---|
842 | # |
(error) | End Card 1 code (ASCII DC1) |
C84 | @ |
C84 | numeric blank, numeric read only |
0C842 | ^ |
2:C42 | "special," alphanumeric read only |
X | ] |
CF1 | flagged 0, numeric read only |
X82 | ! |
C41:C82, F82 | flagged record mark |
XC841 | ] |
CF1 | alternate flagged zero, numeric read only |
XC842 | % |
(error) | Carriage Return (ASCII CR) |
X0C82 | ! |
C41:C82, F82 | alternate flagged record mark |
X8421 | " |
C41:C8421, F8421 | flagged group mark |
Note that the IBM documentation does not mention the 842 and XC842 codes, but Clarence Germain's book, "Programming the IBM 1620, Second Edition" (Prentice-Hall, 1965), page 32, mentions that reading either code numerically will cause an MBR check.
ASCII tape image files are ordinary text files. Each line in the file represents one tape record. The line delimiter acts as an EOL frame. Lines may be delimited by line feed (ASCII hex 0A, Unix/Linux convention), carriage-return/line-feed (ASCII hex 0D0A, Windows convention), or carriage-return only (ASCII hex 0D).
The following table shows the substitution characters recognized by retro-1620 in ASCII-format image files:
ASCII | Hole Pattern | Notes |
---|---|---|
] |
X, XC841 | flagged 0, numeric read only |
| |
082 | record mark |
! |
X82 | flagged record mark |
} |
08421 | group mark |
" |
X8421 | flagged group mark |
_ |
X0C8421 | tape-feed code |
All lower-case letters in an ASCII image file are treated as their upper-case equivalents. Spaces in the file are significant when reading in alphanumeric reading mode and are interpreted as a frame having only a C punch. Spaces are treated as zeroes when read in the numeric reading mode and as a frame with only a C punch when read in the binary reading mode. There is no ASCII equivalent for the alternate flagged record mark (X0C82).
Once files of either format are loaded into the reader's internal buffer, their identity as separate files is lost. The reader sees the buffer as just one long strip of tape.
When the operation is Read Numerically (RN, 36), the translation of frames representing non-numeric characters is the same as for the Card Reader. See Appendix D in the IBM 1620 Central Processing Unit, Model 2 reference manual for details on the translation when reading alphanumeric data numerically.