UsingTheCardReader - pkimpel/retro-1620 GitHub Wiki
The IBM 1622 was a combined card reader/punch unit used with the IBM 1620. The reader and punch were housed in the same cabinet, but effectively were independent units. For information on the 1622, see the IBM 1622 Card Read-Punch manual.
In the retro-1620 emulator, the 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.
There were two models of the 1622. A Model 1 could read 250 cards/minute; the Model 2 could read 500 cards/minute. You can select which model you want to use in the retro-1620 system configuration. The default is a Model 2. Both the reader and punch are either included or excluded as one in a retro-1620 system configuration and will be of the same model.
To use the retro-1620 card reader, you load "card decks" into the reader's "input hopper." The decks are just ASCII text files. The format of these files is discussed in more detail under "Format of Card Deck Files," below. The reader responds to commands from the retro-1620 CPU to read cards one at a time.
The window for the card reader in the emulator looks like this:
Like a real 1622, the emulated card reader has a one-card internal buffer. When the reader is started, it reads a card from the input hopper and places its data in the buffer to await a read command from the CPU. Immediately after the buffered data is transmitted to the CPU, the reader automatically reads the next card and places its data in the buffer. This arrangement allows some CPU processing to overlap the reading of cards.
Unlike a real 1622, however, the emulated card reader does not have a two-stage transport path. When the 1622 reader was started, it fed two cards into the machine and held them there until the buffered data from the first card was read by the CPU, at which point the first card was ejected into the output stacker and another card was fed from the input hopper. When the last card was fed from the input hopper, the reader stopped with two cards remaining in the transport. At that point, the CPU would not be able to read the buffered card until the reader's START button was pressed, which then allowed the two remaining two cards to be read normally. After the final card was read and ejected into the output stacker with the input hopper empty, the reader went not ready again and the LAST CARD lamp on the 1620 Control Panel came on.
In the emulated card reader, cards are simply read until the input hopper becomes empty, at which point the reader becomes not ready and the LAST CARD lamp is turned on. You do not press START to read the last two cards.
When reading cards without much CPU processing taking place between them, it is not unusual for the orange READ INTERLOCK lamp on the Control Panel to come on and stay on. This lamp comes on when the CPU attempts to read a card, and is turned off when the CPU reads data from the card reader's internal buffer. When the CPU is mostly waiting for the next card to be read into the reader's buffer, the lamp will appear to be on continuously.
The card reader window has the following controls and lamps:
POWER READY lamp – this comes on when the reader's window is opened and remains on.
READER READY lamp – this comes on whenever the reader's transport is ready (i.e., after pressing the START or LOAD buttons) and a card has been read and stored in the reader's buffer awaiting a read command from the CPU. It turns off when the STOP button is pressed, when an invalid character turns on the READER CHECK lamp, or after the last card in the input hopper is read by the CPU.
READER CHECK lamp – this comes on when a card with invalid characters is read. It turns off when the NON PROC RNOUT switch is used as described below.
START button – this starts the reader, reads the first card into the reader's buffer, places the reader in a ready status, and turns on the READER READY lamp. It is also used to make the reader ready again after pressing the STOP button. This button is ineffective if the input hopper is empty, the READER READY lamp is on, or the READER CHECK lamp is on.
STOP button – this places the reader in a non-ready status. If the READER READY lamp is on, it is turned off. While the reader is in a non-ready status, the CPU will not be able to read data from the reader's buffer, but will remain in the AUTOMATIC mode with the Control Panel READ INTERLOCK lamp on. This button is ineffective if the READER READY lamp is off.
LOAD button – this works much like the reader's START button, but is used to load the first card into memory at addresses 0-79 and start CPU execution at address 0. That first card typically contains a short program to bootstrap data from more cards into memory. If the CPU is in AUTOMATIC mode, this button functions identically to the reader's START button. For the load operation to succeed, the following conditions must be true:
- The system must be in the MANUAL mode.
- The READER READY lamp must be off.
- The READER CHECK lamp must be off.
- The I/O RD CHK lamp on the Control Panel must be off.
- The CHECK STOP lamp on the Control Panel must be off.
- The reader's buffer must not currently have card data waiting to be read.
That final condition implies that you must not have pressed the reader's START button after loading cards into the input hopper and before pressing the LOAD button. See the discussion on the NON PROC RNOUT switch next for information on clearing the reader's buffer.
NON PROC RNOUT switch – also referred to as "NPRO." On a real 1622, this switch was used to run out the two cards held in the reader's transport path. In the emulator, it has two, somewhat analogous, purposes.
-
If the READER READY lamp is off, clicking this switch will clear the reader's internal one-card buffer. It will also turn off the READER CHECK lamp if it is on. You may need to use this switch after reading a card with invalid characters, or in preparation for loading a deck into the input hopper before pressing the LOAD button.
-
If in addition, the input hopper is not empty, clicking this switch will also pop up an alert showing the amount of data left in the input hopper and asking if you want to empty the hopper. Replying in the affirmative will clear all remaining card images out of the hopper.
The switch is active only when the READER READY lamp is off. You typically use this switch if you simply want to abandon whatever is left in the input hopper, or if one of the cards in your deck has invalid characters so you can unload the deck, fix the text file and then reload it.
The former methods of unloading the stacker by clicking the meter bar or double-clicking the NON PROC RNOUT switch are no longer implemented.
Below the panel of buttons and lamps is a file-picker control. You click the control's Browse... or Select File... button to select deck files to be loaded into the input hopper. 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 input hopper varies by browser and operating system. If the order in which decks are to be read is important, you should load them one at a time. Additional files can be loaded at any time the reader is in a not-ready status.
Below the file picker control is a meter bar that shows the relative amount of data left in the input hopper. The height and styling of the meter varies by browser. The meter's indicator is all the way to the right after loading one or more card deck files and shrinks to the left as cards are read.
Below the meter bar is a white area that will show the cards most recently read. The last card read is on the bottom. You can change the size of this area by resizing the reader's window vertically. This display is useful to see where you are in the progress of reading, or to spot invalid characters if a card has caused a READER CHECK and halted the reader.
You can view all "decks" currently loaded into the reader by double-clicking the white area. This will open a temporary window to display the card images. The window will open only if reader has cards loaded and is in a not-ready condition.
The contents of the window are divided into three sections, not all of which may be present in a given situation.
- The first section shows the cards that have been read, and corresponds to the reader's output stacker. This will not be present if no cards have been read since cards were last loaded into the reader or the input hopper was cleared.
- The second section, which is highlighted with a border, shows the last card read. This will not be present if no cards have been read since cards were last loaded into the reader or the input hopper was cleared.
- The third section shows cards that have not been read yet, and corresponds to the reader's input hopper. It will not be present if no more unread cards are in the input hopper.
The temporary window is static and displays the status of the input hopper and output stacker only at the point the window was opened. You can start and stop the reader as often as you wish and double-click the white area to open a new window and view the current status. When finished with the temporary window, simply close it.
The reader retains the previously-read cards in its output stacker until the next time cards are loaded. When new cards are loaded, the images for all cards read up to that point are discarded, and the new card images are appended to any cards that were previously loaded but have not yet been read. Therefore, immediately after loading new cards, the first two sections of the window discussed above will not be present.
As mentioned above, card decks are just plain ASCII text files. The lines in the files may be of variable length – lines shorter than 80 characters are padded to 80 with spaces, and lines longer than 80 characters are truncated at 80. Any truncated data is ignored.
Once files are loaded into the reader's input hopper, their identity as separate files is lost. The reader sees the input hopper as just a stack of card images.
The following ASCII characters are valid for card reader input. Any other characters read by the reader are considered to be invalid and will cause the reader to stop in a not-ready state with the READER CHECK lamp on. These conventions are based on those used by the Computer History Museum IBM 1620 Jr. project.
When the operation is Read Numerically (RN, 36), including when reading the first card as a result of pressing the reader's LOAD button, the translation is as follows. See Appendix D of the IBM 1620 Central Processing Unit, Model 2 reference manual for details on the translation when reading alphanumeric data numerically.
ASCII character | Stored as |
---|---|
0 -9
|
0-9, respectively |
Space | 0 |
+ |
0 |
A -I
|
1-9, respectively |
] |
flagged 0 |
J -R
|
flagged 1-9, respectively |
S -Z
|
2-9, respectively |
/ |
1 |
. |
hexadecimal B |
, |
hexadecimal B |
= |
hexadecimal B |
$ |
flagged hexadecimal B |
@ |
hexadecimal C, the numeric-blank code |
( |
hexadecimal C, the numeric-blank code |
) |
hexadecimal C, the numeric-blank code |
* |
flagged hexadecimal C |
~ |
flagged hexadecimal C |
| |
hexadecimal A, the Record Mark (‡ ) code |
! |
flagged hexadecimal A, a flagged Record Mark |
} |
hexadecimal F, the Group Mark (≢ ) code |
" |
flagged hexadecimal F, a flagged Group Mark |
When the operation is Read Alphanumerically (RA, 37):
ASCII character | Stored as |
---|---|
0 -9
|
70-79, respectively |
Space | 00 |
A -Z
|
41-69, respectively |
. |
03 |
, |
23 |
$ |
13 |
@ |
34 |
+ |
10 |
- |
20 |
* |
14 |
/ |
21 |
= |
33 |
( |
24 |
) |
04 |
| |
0A, the Record Mark (‡ ) code |
! |
5A, the flagged Record Mark code |
} |
0F, the Group Mark (≢ ) code |
" |
5F, the flagged Group Mark code |
All lower-case letters are treated as their upper-case equivalents.
Note that for both numeric and alphanumeric input, no Record Mark is stored in memory automatically. You must use the |
character on a card to enter one into memory if needed.