ArticleslgStudy

science

C0 and C1 control codes

C0 and C1 control codes is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand C0 and C1 control codes rather than just read about it. In short: The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that the text has been received.

Key takeaways

  • C0 and C1 control codes belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect C0 and C1 control codes to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of C0 and C1 control codes from memory before moving on to harder problems.

Reference excerpt

The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that the text has been received. C0 codes are the range 00HEX–1FHEX and the default C0 set was originally defined in ISO 646 (ASCII). C1 codes are the range 80HEX–9FHEX and the default C1 set was originally defined in ECMA-48 (harmonized later with ISO 6429). The ISO/IEC 2022 system of specifying control and graphic characters allows other C0 and C1 sets to be available for specialized applications, but they are rarely used.

C0 controls ASCII defines 32 control characters, plus the DEL character. This large number of codes was desirable at the time, as multi-byte controls would require implementation of a state machine in the terminal, which was very difficult with contemporary electronics and mechanical terminals. Many of the controls were designed for terminals to transmit large messages (such as news articles) from one to another, with no computer involved. Only a few codes have maintained their use: BEL, ESC, and the format effector (FEn) characters BS, HT, LF, VT, FF, and CR. Others are unused or have acquired different meanings such as NUL being the C string terminator. Some data transfer protocols such as ANPA-1312, Kermit, and XMODEM do make extensive use of SOH, STX, ETX, EOT, ACK, NAK and SYN for purposes approximating their original definitions; and some file formats use the "Information Separators" (ISn) such as the Unix info format and Python's splitlines string method. The names of some codes were changed in ISO 6429:1992 (or ECMA-48:1991) to be neutral with respect to writing direction. The abbreviations used were not changed, as the standard had already specified that those would remain unchanged when the standard is translated to other languages. In this table both new and old names are shown for the renamed controls (the old name is the one matching the abbreviation). Unicode provides Control Pictures that can replace C0 control characters to make them visible on screen. However caret notation is used more often.

C1 controls In 1973, ECMA-35 and ISO 2022 attempted to define a method so an 8-bit "extended ASCII" code could be converted to a corresponding 7-bit code, and vice versa. In a 7-bit environment, the Shift Out (SO) would change the meaning of the 96 bytes 0x20 through 0x7F (i.e. all but the C0 control codes), to be the characters that an 8-bit environment would print if it used the same code with the high bit set. This meant that the range 0x80 through 0x9F could not be printed in a 7-bit environment, thus it was decided that no alternative character set could use them, and that these codes should be additional control codes, which become known as the C1 control codes. To allow a 7-bit environment to use these new controls, the sequences ESC @ through ESC _ were to be considered equivalent. The later ISO 8859 standards abandoned support for 7-bit codes, but preserved this range of control characters. The first C1 control code set to be registered for use with ISO 2022 was DIN 31626, a specialised set for bibliographic use which was registered in 1979. The more common general-use ISO/IEC 6429 set was registered in 1983, although the ECMA-48 specification upon which it was based had been first published in 1976 and JIS X 0211 (formerly JIS C 6323). Symbolic names defined by RFC 1345 and early drafts of ISO 10646, but not in ISO/IEC 6429 (PAD, HOP and SGC) are also used. Except for SS2 and SS3 in EUC-JP text, and NEL in text transcoded from EBCDIC, the 8-bit forms of these codes were almost never used. CSI, DCS and OSC are used to control text terminals and terminal emulators, but almost always by using their 7-bit escape code representations. Nowadays if these codes are encountered it is far more likely they are intended to be printing characters from that position of Windows-1252 or Mac OS Roman. Except for NEL, Unicode does not provide a "control picture" for any of these. There is no well-known variation of Caret notation for them either.

Other control code sets The ISO/IEC 2022 (ECMA-35) extension mechanism allowed escape sequences to change the C0 and C1 sets. The standard C0 control character set shown above is chosen with the sequence ESC ! @ and the above C1 set chosen with the sequence ESC " C. Several official and unofficial alternatives have been defined, but this is pretty much obsolete. Most were forced to retain a good deal of compatibility with the ASCII controls for interoperability. The standard makes ESC, SP and DEL "fixed" coded characters, which are available in their ASCII locations in all encodings that conform to the standard. It also specifies that if a C0 set included transmission control (TCn) codes, they must be encoded at their ASCII locations and could not be put in a C1 set, and any new transmission controls must be in a C1 set.

Alternative C0 character sets ANPA-1312, a text markup language used for news transmission, replaces several C0 control characters. IPTC 7901, the newer international version of the above, has its own variations. Videotex has a completely different set. Teletext also defines a set similar to Videotex. T.61/T.51, and others replaced EM and GS with SS2 and SS3 so these functions could be used in a 7-bit environment without resorting to escape sequences. Some sets replaced FS with SS2, (same as ANPA-1312). The now-withdrawn JIS C 6225, designated JIS X 0207 in later sources. replaced FS with CEX or "Control Extension" which introduces control sequences for vertical text behaviour, superscripts and subscripts and for transmitting custom character graphics.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with C0 and C1 control codes

Start with the simplest possible case. Write down what C0 and C1 control codes claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to C0 and C1 control codes before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about C0 and C1 control codes ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of C0 and C1 control codes

In research
C0 and C1 control codes appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses C0 and C1 control codes in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
C0 and C1 control codes is common in secondary-school and first-year university syllabi. It links to neighbouring topics Control characters, so understanding it makes those chapters shorter.
In everyday life
Look for C0 and C1 control codes outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “C0 and C1 control codes” →

How to study C0 and C1 control codes in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what C0 and C1 control codes means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain C0 and C1 control codes out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is C0 and C1 control codes in simple terms?

The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that t…

Why does C0 and C1 control codes matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study C0 and C1 control codes?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on C0 and C1 control codes.

Tags

  • Control characters

Keep exploring