# Tools and Formats

Here are several sets of tools. Some were used in preparing the data here, others may be useful in working with the files. Also there is an explanation of the file formats. The tools are all coded and compiled for Windows 95/NT or later PC environment for command-line use in a "DOS" window, but they should port easily to other command-line oriented systems. Source is provided for everything and most of the tools were last built using Microsoft Visual C.

## File Formats

The data on these old computers came in different forms than we commonly use today. Everything was oriented around 6-bit characters instead of 8-bit bytes, and the character codes were BCD instead of ASCII. This section explains the standard formats I use to transform the data into byte-oriented files and discusses tools to convert between different formats.

### Extensions

The format of the data is indicated by the file extension.

- .BCD - Even parity BCD tape
- .BIN - Odd parity binary tape
- .CBN - Column binary card image

In addition, .txt indicates ASCII text.

### Tape Formats

All files correspond to 7-track tapes. The low 6 bits of each byte in the file contain one character. There is a parity bit in the next bit, odd parity for binary (.BIN) files and even parity for BCD files. The eighth bit is set in the first character of each record. File marks (in both binary and BCD tapes) consist of a special record containing one or two 0017 (0x0F) characters. (There should only be one 0017, but some programs may use two. This should be cleaned up at some point.) Zero is technically illegal but may be ignored when reading. The special character 0200 (0x80) may appear as the last character of a file.

Files produced by the "g7t" tape reading and decoding programs retain all uncorrected errors and thus may have characters with the wrong parity or even zero. The "g7t" programs also use intermediate files that are extensions of these formats, containing more raw information for the decoding process.

### Card Formats

Card decks containing only text may be encoded as .BCD files with 80-character records, as if from an unblocked tape.

Column binary files (.CBN) are binary tape files which contain pairs of characters, the first of which is the 9-4 rows and the second the 3-12 rows of a card. The 9 or 3 row is in the least significant bit. The number of characters in a record must be even, and is normally 160, but trailing blank columns may be eliminated.

### Conversion tools

The programs "xxx2xxx" may be used to translate from one form to another. Note, however, that it is possible to lose information. For instance, using cbn2bcd and then bcd2cbn will work on cards containing text but will generate garbage if used on arbitrary column binary cards. On the other hand, the programs bin2txt and txt2bin exist to make it easier to shuffle a text-only card deck. They translate to ascii files which accurately retain the text so it can be manipulated with a text editor.

### SPS

The 1401 SPS files arrived in a different format. That format is described with them on the 1401 page. They were converted to the formats described above with the "spscvt" tool below.

## Tools

There are two sets of tools. The first ones here are useful for working with the files. The second set is programs that were used in preparing the data and are included for reference in case its necessary to decipher the finer points of the log output, or they may be modified and run again to obtain better versions of the data. In particular, the "g7t" directory contains both the tools and all the original raw data from the Ohio tapes.

See the Notes for "g7t" for documentation on g7tedit, which was used in the preparation of some of the tapes but is also a useful (if basic) utility on its own.

### Utilities

- Convert The "xxx2xxx" conversion tools described above.
- BCDTape A program for dumping BCD tape files.

### Preparation programs

- t7 The old tape reading program, used to read my tapes.
- g7t (Notes) The new tape reading programs, used on the Ohio tapes.
- spscvt Converts the original SPS file format to the formats above.

### BCD/TXT

The bcd2txt and txt2bcd programs translate between BCD and ASCII. Unfortunately BCD contains several optional codings and several characters that do not appear in standard ASCII. Below is a table of the translation used in several simulators, includingvthe Newcomer/Jaeger 1401 simulator here, and my programs including bcd2txt, txt2bcd and the 709x simulator.

The first four columns are for simulators. The Bob S. column is for Bob Supnik's 1401 simulator, easily available on the web. The next two columns are for another Bob working on a 1401 simulator and the old version of my simulator. Finally the Newcomer column is for the 1401 simulator here.

The A and F columns are for the "business" and "Fortran" chains for the 1403 printer, from Bob Supnik.

The last column is for my programs here. Where there are two characters, txt2bcd will accept either and bcd2txt will produce the first (business) unless -f (Fortran) is specified. At the far right some of the strange original BCD characters are described in parentheses. The code octal 20 is special, it is used on tape to represent 00 in core and so normally would not be printable. With bcd2txt the default is to convert it to "^" so it doesn't disappear when converting both ways, but with -b it will convert to a blank which is the normal case and should work with most editing tasks. This table is in the file asciibcd.h.

    octal  Bob S.  Bob A.  P. Old  Newcomer       A    F      Pierce
     00                                                             (Blank)
     01     1       1       1         1           1    1        1
     02     2       2       2         2           2    2        2
     03     3       3       3         3           3    3        3
     04     4       4       4         4           4    4        4
     05     5       5       5         5           5    5        5
     06     6       6       6         6           6    6        6
     07     7       7       7         7           7    7        7
     10     8       8       8         8           8    8        8
     11     9       9       9         9           9    9        9
     12     0       0       0         0           0    0        0
     13     #       #       =         = #         #    =        # =
     14     @       @       '         ' @         @    '        @ '
     15     :       :       :         :                         :
     16     >       >       >         >                         >
     17     (       t              Radical 0xFB        {        {   (Tape Mark)
     20     ^       c                 b                ^        ^   (Cents or b with a stroke)
     21     /       /       /         /           /    /        /
     22     S       S       S         S           S    S        S
     23     T       T       T         T           T    T        T
     24     U       U       U         U           U    U        U
     25     V       V       V         V           V    V        V
     26     W       W       W         W           W    W        W
     27     X       X       X         X           X    X        X
     30     Y       Y       Y         Y           Y    Y        Y
     31     Z       Z       Z         Z           Z    Z        Z
     32     '       r                 |                |        |   (Record Mark)
     33     ,       ,       ,         ,           ,    ,        ,
     34     %       %       (         % (         %    (        % (
     35     =       =                 ^                         ~
     36     \       '       \         \                         \
     40     -       -       -         -           -    -        -
     41     J       J       J         J           J    J        J
     42     K       K       K         K           K    K        K
     43     L       L       L         L           L    L        L
     44     M       M       M         M           M    M        M
     45     N       N       N         N           N    N        N
     46     O       O       O         O           O    O        O
     47     P       P       P         P           P    P        P
     50     Q       Q       Q         Q           Q    Q        Q
     51     R       R       R         R           R    R        R
     52     !       !       !         !           -    -        !
     53     $       $       $         $           $    $        $
     54     *       *       *         *           *    *        *
     55     ]       )       ]         ]                         ]
     56     ;       ;       ;         ;                         ;
     57     _       d               Delta 0x7F                  _   (Delta)
     60     &       &       +         + &         &    &        & +
     61     A       A       A         A           A    A        A
     62     B       B       B         B           B    B        B
     63     C       C       C         C           C    C        C
     64     D       D       D         D           D    D        D
     65     E       E       E         E           E    E        E
     66     F       F       F         F           F    F        F
     67     G       G       G         G           G    G        G
     70     H       H       H         H           H    H        H
     71     I       I       I         I           I    I        I
     72     ?       ?       ?         ?           &    &        ?
     73     .       .       .         .           .    .        .
     74     )       o       )         )           )    )        )   (Lozenge)
     75     [       (       [         [                         [
     76     <       <       <         <                         <
     77 *   "       g            Group Mark 0xCE       }        }   (Group Mark)

Back

Back to the Collection