Hi, zpatch-ga:
The control key (CTRL) is a legacy to us from the era of teletype
terminals (TTY's). The word "control" refers to terminal operations
_other_ than printing characters. For example:
Ctrl-G (BEL) Ring a bell
Ctrl-H (BS) Backspace
Ctrl-I (HT or TAB) Horizontal tabulation
Ctrl-J (LF) Line feed
Ctrl-K (VT) Vertical tabulation
Ctrl-L (FF) Form feed
Ctrl-M (CR) Carriage return
Many of these operations involve movement of the platen (the roller in
a typewriter which advances the paper left to right as well as up and
down), and hence the variant description of these as "carriage control
codes".
For a quick sketch of how the 7-bit ASCII code developed from earlier
5-bit telegraph codes ("Baudot"), see this Web page:
[Teletype Codes]
http://www.knobstick.ca/museum/codes1.htm
Note that the word "teletype" was used in relation to both the
transmissions of telegraph messages and again with regard to printing
terminals that received (and sent) messages in ASCII code. The most
obvious benefit of enlarging the code space from 5- to 7-bits was
making room for lowercase letters (the Baudot codes were
conventionally uppercase only). Both sorts of devices would typically
incorporate paper tape punches & readers, in addition to a
typewriter-like printing mechanism.
Careful examination of the ASCII chart referenced above will show that
the control key has a fairly simple "effect" on the code produced by
any alphabetic key, namely setting the two highest order bits to zero.
Suppressing the two highest bit has the effect of limiting the range
of values to 0 through 31. In this sense the Ctrl and Shift keys can
both be called "metakeys" because their original effects were merely
to modify the results produced by other keys.
Let's illustrate this with regard to the Ctrl-M (carriage return)
"character". The ASCII code for capital M is (decimal) 77 or in
binary 1001101, while the code for little m is (decimal) 109 or in
binary 1101101. Note that the uppercase and lowercase letters differ
by 32, or by setting the penultimate (next to highest order) bit in
the 7-bit code to obtain the lowercase version. In this regard ASCII
ordering puts all the uppercase letters before all the lowercase one.
If both the two highest order bits are set to zero, then Ctrl-M and
Ctrl-m would amount to the same code, (decimal) 13 or binary 0001101.
Thus in a true TTY interface, the use of a Shift key in combination
with Ctrl (to modify the code produced) would be redundant. A
personal computer, however, is much more closely integrated with the
keyboard, so both Ctrl and Shift can be combined, if desired, to
produce varying results (as can the newer "meta" key, Alt).
For a nice explanation of the original uses of "control codes", see
this page:
[ASCII Contol Codes from alt.folklore.computers]
http://www.everything2.org/index.pl?node=control%20codes
As you'll see there, the phrase "control code" came to be applied to a
few ASCII values at the upper end of the 7-bit range, in addition to
the bottom block between 0 and 31. Of those, the one which has best
survived the passage of time is ASCII (decimal) 127 or RO (Rubout), in
many cases useful as a terminal code to "erase" characters, e.g. for
password protection.
A discussion of control codes is still relevant to modern "UNIX"
computing environments which emphasize "terminal emulation" as part of
the user's configuration, e.g. through a "termcaps" file. As
electronic terminals began to replace the less reliable mechanical
TTY's, these were referred to as "glass TTY's". Today the VT1OO and
various brands survive as designations for a package of terminal
capabilities that must emulate the original TTY behaviors.
regards, mathtalk-ga
Search Strategy
Keywords: "control codes" teletype
://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%22control+codes%22+teletype&btnG=Google+Search |