This array consists of 256 characters, like “maptab”. Unfortunately the initialisation of “partab” was omitted from the UNIX Operating System Source Code booklet. It is certainly needed, and so is given now:
char partab [] { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, 0001,0201,0201,0001,0201,0001,0001,0201, 0200 0000,0000,0200,0000,0200,0200,0000, 0000 0200,0200 0000,0200,0000,0000,0200, 0000,0200,0200 0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0200, 0000,0200,0200,0000,0200,0000,0000,0200, 0200 0000,0000 0200,0000,0200,0200,0000, 0000 0200,0200 0000,0200,0000,0000,0200, 0200,0000,0000,0200,0000,0200,0200,0000, 0200,0000,0000,0200,0000,0200,0200,0000, 0000,0200,0200,0000,0200,0000,0000,0201 };
Each element of “partab” is an eight bit character, which, with the use of appropriate bitmasks (0200 and 0177), can be interpreted as a two part structure:
bit 7 |
parity bit; |
bits 3-5 |
not used. Always zero; |
bits 0-2 |
code number. |
The parity bit is appended to the seven bit ASCII code when a character is transmitted by the computer, to form an eight bit code with even parity.
The code number is used by “ttyoutput” (8426) to classify the character into one of seven categories for determining the delay which should ensue before the transmission of the next character. (This is particularly important for mechanical printers which require time for the carriage to return from the end of a line, etc.)