The American Standard Code for Information Interchange was developed in the 1960s for use in teletype machines and similar devices. It also anticipated use by computers, although computer networking at the time was still largely theoretical. It was not intended to be used as an internal computer character set, but it became the standard character set, partly due to the influence of UNIX. It still exists today as the first 128 code points of Unicode.
The first 32 characters and the last character are control codes. Each control code has a very specific function.
null. ASCII was designed specifically for use with punched paper tape. A reel of paper tape is a stream of rows. Each row contains one character. A hole in the tape represented a 1 bit. A row with no punches was empty tape, or leader. A character containing only 0 bits should be ignored by the receiver.
delete. To delete a character on a paper tape, punch out all of the holes in the row. A character containing only 1 bits should be ignored by the receiver.
device control one. Turn the paper tape reader on.
device control two. Turn the paper tape puncher on.
device control three. Turn the paper tape reader off.
device control four. Turn the paper tape puncher off.
backspace. Move the print head back one space. This was not a deletion. Deletion is done on the paper tape with del.
tabulation. Advance to the next tabstop. ASCII did not provide a way to define tabstops, nor did it define a default tab spacing. We still do not have an international tabstop standard. tab was not intended to be a data separator. That was what us was for.
carriage return. Move the print head to the left edge. Some terminals could not complete the move in a single character time, so lf and nul characters would be sent to prevent the printing of a character in the middle of the page.
line feed. Roll the paper ahead one line. lf was usually issued after cr because moving the print head to the left edge could be slow. The paper could be rolled while the print head was still in motion. This character is sometimes called newline.
form feed. Eject the current page, advancing to the top of the next page.
vertical tabulation. Roll the paper ahead to the next vertical tabstop. ASCII did not provide a way to define vertical tabstops, nor did it define a default vertical tab spacing.
start of heading. A message could have an optional header that could include delivery or routing information.
start of text. A message starts with this character.
end of text. A message ends with this character. Sometimes it is followed by an error detection code such as CRC-16.
end of tranmission block. This allowed for breaking a long message into smaller blocks that could be individually acknowledged.
acknowledge. The message was received.
negative acknowledge. The message was not received correctly. In most cases, similar control characters have similar codes, but ack and nak were separated to give more resistence against transmission errors. It would require three bit errors to transform ack into nak.
end of transmission.
end of medium. This could mark the end of a tape.
enquiry. Ask the other station to identify itself. Some teletypes, on receiving this character, would automatically reply with a preprogrammed string.
Pressing the here is key would also transmit the preprogrammed string.
bell. Ring the bell to get the operator's attention.
synchronous idle. In the synchronous transmission mode, the channel is given a steady stream of bits with no framing bits around the characters. The two stations synchronize a character clock so that they agree on when it is time to start the next character. When a sender has nothing to send, it sends the syn character. The receiver can look for a pattern of syn characters for synchronization.
cancel. The remainder of the message will not be sent. Oops.
substitute. The character that was supposed to be sent was somehow lost. Oops.
shift out. Switch to an alternate character set. Early in the design of ASCII, this was going to be used to access lower case, similar to the use of shift on typewriter keyboards. so and si were retained for accessing an alternate character set. It was sometimes used to select the ribbon color.
escape. esc was another way of accessing an alternate character set. One use of esc was to add an eighth bit to the next character.
data link escape. Do not treat the next character as a control character.
Some of these codes are still reflected in modern keyboards (delbstabesc) but now have very different meanings.
The original purpose of the ctrl key was to generate these control characters by subtracting 64 from certain codes.
ctrlA generated soh.
ctrlZ generated sub.
Six of the control characters could be generated by using ctrlshift together.