C0 and C1 control codes

From Wikipedia, the free encyclopedia

(Redirected from Device control 2)
Jump to: navigation, search

The C0 and C1 control code sets define control codes for use in text. C0, originally defined in ISO 646, defines codes in the range 00HEX–1FHEX. C1, originally defined in ISO 6429, defines codes in the range 80HEX–9FHEX. The C0 codes are contained in ASCII and most encodings based on it. The C1 codes were included in the ISO-8859-n series of encodings and Unicode but are rarely used directly, except on specific platforms such as OpenVMS. When they turn up in documents, Web pages, e-mail messages, etc., which are ostensibly in an ISO-8859-n encoding, their code positions generally actually refer to the characters at that position in a proprietary, system-specific encoding such as Windows-1252 or the Apple Macintosh ("MacRoman") character set, though this is technically invalid under the ISO encodings. Such characters are more commonly accessed using the equivalent two octet escape sequence.

Most applications only interpret the C0 control codes for LF, CR, and HT. A few applications also interpret C0 codes VT and FF, and the C1 code NEL. Very few applications interpret the other C0 and C1 control codes.

Contents

[edit] C0 (ASCII and derivatives)

SeqDecHexAbbrCharacter nameDescription/notes
^@000x00NULNullOriginally used to allow gaps to be left on paper tape for edits. Later used for padding after a code that might take a terminal some time to process (e.g. a carriage return or line feed on a printing terminal). Now often used as a string terminator, especially in the C programming language.
^A010x01SOHStart of Heading First character of a message heading. In some computer terminals, moves cursor to the first column.
^B020x02STXStart of Text First character of message text, and may be used to terminate the message heading.
^C030x03ETXEnd of TextOften used as a "break" character (Ctrl-C) to interrupt or terminate a program or process. In TOPS-20, it was used to gain the system's attention before logging in.
^D040x04EOTEnd of TransmissionUsed on Unix to signal end-of-file condition on, or to logout from, a terminal. On Apple II systems, it signaled that a DOS command followed.
^E050x05ENQEnquiry Signal intended to trigger a response at the receiving end, to see if it is still present. In some computer terminal and EMACS , moves the cursor to the end of current line.
^F060x06ACKAcknowledge response to an ENQ, or an indication of successful receipt of a message.
^G070x07BELBellOriginally used to sound a bell on the terminal. Later used for a beep on systems that didn't have a physical bell. May also quickly turn on and off inverse video (a visual bell).
^H080x08BS BackspaceMove the cursor one position leftwards. On input, this may delete the character to the left of the cursor.
^I090x09HT Horizontal TabPosition to the next horizontal tab stop.
^J100x0ALF Line FeedOn typewriters, printers, and some terminal emulators, moves the cursor down one row without affecting its column position. On Unix, used to mark end-of-line. In MS-DOS, Windows, and various network standards, used following CR as part of the end-of-line mark.
^K110x0BVT Vertical TabPosition the form at the next vertical tab stop.
^L120x0CFF Form FeedOn printers, load the next page. Treated as whitespace in many programming languages, and may be used to separate logical divisions in code. In some terminal emulators, it clears the screen.
^M130x0DCR Carriage ReturnOriginally used to move the cursor to column zero while staying on the same line. On Mac OS (pre-Mac OS X), as well as in earlier systems such as the Apple II and Commodore 64, used to mark end-of-line. In MS-DOS, Windows, and various network standards, it is used preceding LF as part of the end-of-line mark. The Enter or Return key on a keyboard will send this character, but it may be converted to a different end-of-line sequence by a terminal program.
^N140x0ESO Shift OutSwitch to an alternate character set.
^O150x0FSI Shift InReturn to regular character set after Shift Out. In TOPS-20, it signalled that further output should be discarded; the program would continue to run but not display or print anything until ^O is typed again.
^P160x10DLEData Link EscapeCause the following data to be interpreted as raw data, not control codes.
^Q170x11DC1Device Control 1/XONResume transmission. Used for software flow control. In some terminal programs, ends pause started with Ctrl-S.
^R180x12DC2Device Control 2In TOPS-20, reprinted the current line, tidying up any character deletions.
^S190x13DC3Device Control 3/XOFFSuspend transmission. Used for software flow control. In some terminal programs, pauses display of text.
^T200x14DC4Device Control 4In TOPS-20, it caused a brief system-status line to be displayed.
^U210x15NAKNegative Acknowledge Sent by a station as a negative response to the station with which the connection has been set up. In binary synchronous communication protocol, the NAK is used to indicate that an error was detected in the previously received block and that the receiver is ready to accept retransmission of that block. In multipoint systems, the NAK is used as the not-ready reply to a poll. In some text editors, it was used as a "Delete Line" character.
^V220x16SYNSynchronous Idle Used in synchronous transmission systems to provide a signal from which synchronous correction may be achieved between data terminal equipment, particularly when no other character is being transmitted. In some terminal programs, allows literal entry of control codes without them being interpreted.
^W230x17ETBEnd of Transmission Block Indicates the end of a transmission block of data when data are divided into such blocks for transmission purposes. In some text editors, it is used as a "Delete Word" character which rubs out the previous text entry back to the preceding space.
^X240x18CANCancel Indicates that the data with which it is associated are in error or are to be disregarded, or cannot be represented on a particular device.
^Y250x19EM End of MediumIn many programs, a keyboard input of Ctrl-Y is a "redo" command to undo the last Ctrl-Z undo command.
^Z260x1ASUBSubstituteOn MS-DOS systems with files opened in text mode, "end of text" or "end of file" is marked by the Ctrl-Z character (code 26, "Substitute"), instead of ^C or ^D common on other operating systems. In many programs, a keyboard input of Ctrl-Z is an "undo" command to reverse the most recent input or action. In many terminal programs, this will suspend the active process and return control to the shell.
^[270x1BESCEscapeThe ESC key on the keyboard will cause this character to be sent on most systems. It can be used in software user interfaces to exit from a screen, menu, or mode, or in device-control protocols (e.g., printers and terminals) to signal that what follows is a special command sequence rather than normal text.
^\280x1CFS File SeparatorCan be used as delimiters to mark fields of data structures. If used for hierarchical levels, US is the lowest level (dividing plain-text data items), while RS, GS, and FS are of increasing level to divide groups made up of items of the level beneath it. These can usually be generated by holding down Ctrl and the backslash, right square bracket, caret, and underscore keys respectively.
^]290x1DGS Group Separator
^^300x1ERS Record Separator
^_310x1FUS Unit Separator
^?1270x7FDELRubout/DeleteOriginally used to mark deleted characters on paper tape, since any character could be changed to all ones by punching holes everywhere. On VT100 compatible terminals, this is the character generated by the key labelled ⌫, usually called backspace on modern machines, and does not correspond to the PC delete key.

[edit] C1 (ISO 8859 and Unicode)

DecHexEsc SeqShort Abbr
(RFC 1345)
Full AbbrCharacter nameDescription/notes
1280x800x1B 0x40PAPADPadding Characterlisted as XXX in unicode
1290x810x1B 0x41HOHOPHigh Octet Preset
1300x820x1B 0x42BHBPHBreak Permitted Here
1310x830x1B 0x43NHNBHNo Break Here
1320x840x1B 0x44ININDIndexDeprecated in 1986 and withdrawn in 1991 from ISO/IEC 6429 (ECMA-48)
1330x850x1B 0x45NLNELNext LineUsed to mark end-of-line on some IBM mainframes.
1340x860x1B 0x46SASSAStart of Selected Area
1350x870x1B 0x47ESESAEnd of Selected Area
1360x880x1B 0x48HSHTSHorizontal Tab Set
1370x890x1B 0x49HJHTJHorizontal Tab Justified
1380x8A0x1B 0x4AVSVTSVertical Tab Set
1390x8B0x1B 0x4BPDPLDPartial Line Forward Used to produce subscripts and superscripts in ISO/IEC 6429, e.g., in a printer.
Subscripts use PLD text PLU while superscripts use PLU text PLD..
1400x8C0x1B 0x4CPUPLUPartial Line Backward
1410x8D0x1B 0x4DRIRI Reverse Line Feed
1420x8E0x1B 0x4ES2SS2Single-Shift 2
1430x8F0x1B 0x4FS3SS3Single-Shift 3
1440x900x1B 0x50DCDCSDevice Control String
1450x910x1B 0x51P1PU1Private Use 1
1460x920x1B 0x52P2PU2Private Use 2
1470x930x1B 0x53TSSTSSet Transmit State
1480x940x1B 0x54CCCCHCancel character
1490x950x1B 0x55MWMW Message Waiting
1500x960x1B 0x56SGSPAStart of Protected Area
1510x970x1B 0x57EGEPAEnd of Protected Area
1520x980x1B 0x58SSSOSStart of String
1530x990x1B 0x59GCSGCISingle Graphic Char Introlisted as XXX in unicode
1540x9A0x1B 0x5ASCSCISingle Char Intro
1550x9B0x1B 0x5BCICSIControl Sequence Introducer
1560x9C0x1B 0x5CSIST String Terminator
1570x9D0x1B 0x5DOCOSCOS Command
1580x9E0x1B 0x5EPMPM Private Message
1590x9F0x1B 0x5FACAPCApp Program Command

[edit] References

Views
Personal tools

Toolbox