2 The following table of the ANSI X3.64 encodings is the result of some work I
3 did a few years ago for BYTE magazine. BYTE made this table available for
4 download from several bulletin-board systems, so I see no reason why it cannot
5 be posted here for whatever private use you care to make. Just don't expect
6 to make a profit selling copies of it without paying royalties to McGraw-Hill.
8 Oh, by the way, the equivalent ISO standard is DP-6429.
13 ANSI Standard (X3.64) Control Sequences for Video Terminals and Peripherals
14 in alphabetic order by mnemonic
16 (Inspired by the article "Toward Standardized Video Terminals: ANSI
17 X3.64 Device Control" by Mark L. Siegel, April 1984 BYTE, page 365)
19 (Ps and Pn are parameters expressed in ASCII.)
20 (Numeric parameters are given in decimal radix.)
21 (Abbreviations are explained in detail at end.)
22 (Spaces used in this table for clarity are not
23 used in the actual codes.)
26 Sequence Sequence Parameter or
27 Mnemonic Name Sequence Value Mode
28 ---------------------------------------------------------------------------
29 APC Applicatn Program Command Esc Fe Delim
30 CBT Cursor Backward Tab Esc [ Pn Z 1 eF
31 CCH Cancel Previous Character Esc T
32 CHA Cursor Horzntal Absolute Esc [ Pn G 1 eF
33 CHT Cursor Horizontal Tab Esc [ Pn I 1 eF
34 CNL Cursor Next Line Esc [ Pn E 1 eF
35 CPL Cursor Preceding Line Esc [ Pn F 1 eF
36 CPR Cursor Position Report Esc [ Pn ; Pn R 1, 1
37 CSI Control Sequence Intro Esc [ Intro
38 CTC Cursor Tab Control Esc [ Ps W 0 eF
39 CUB Cursor Backward Esc [ Pn D 1 eF
40 CUD Cursor Down Esc [ Pn B 1 eF
41 CUF Cursor Forward Esc [ Pn C 1 eF
42 CUP Cursor Position Esc [ Pn ; Pn H 1, 1 eF
43 CUU Cursor Up Esc [ Pn A 1 eF
44 CVT Cursor Vertical Tab Esc [ Pn Y eF
45 DA Device Attributes Esc [ Pn c 0
46 DAQ Define Area Qualification Esc [ Ps o 0
47 DCH Delete Character Esc [ Pn P 1 eF
48 DCS Device Control String Esc P Delim
49 DL Delete Line Esc [ Pn M 1 eF
50 DMI Disable Manual Input Esc \ Fs
51 DSR Device Status Report Esc [ Ps n 0
52 EA Erase in Area Esc [ Ps O 0 eF
53 ECH Erase Character Esc [ Pn X 1 eF
54 ED Erase in Display Esc [ Ps J 0 eF
55 EF Erase in Field Esc [ Ps N 0 eF
56 EL Erase in Line Esc [ Ps K 0 eF
57 EMI Enable Manual Input Esc b Fs
58 EPA End of Protected Area Esc W
59 ESA End of Selected Area Esc G
60 FNT Font Selection Esc [ Pn ; Pn Space D 0, 0 FE
61 GSM Graphic Size Modify Esc [ Pn ; Pn Space B 100, 100 FE
62 GSS Graphic Size Selection Esc [ Pn Space C none FE
63 HPA Horz Position Absolute Esc [ Pn ` 1 FE
64 HPR Horz Position Relative Esc [ Pn a 1 FE
65 HTJ Horz Tab w/Justification Esc I FE
66 HTS Horizontal Tab Set Esc H FE
67 HVP Horz & Vertical Position Esc [ Pn ; Pn f 1, 1 FE
68 ICH Insert Character Esc [ Pn @ 1 eF
69 IL Insert Line Esc [ Pn L 1 eF
71 INT Interrupt Esc a Fs
72 JFY Justify Esc [ Ps ; ... ; Ps Space F 0 FE
73 MC Media Copy Esc [ Ps i 0
74 MW Message Waiting Esc U
75 NEL Next Line Esc E FE
76 NP Next Page Esc [ Pn U 1 eF
77 OSC Operating System Command Esc ] Delim
78 PLD Partial Line Down Esc K FE
79 PLU Partial Line Up Esc L FE
80 PM Privacy Message Esc ^ Delim
81 PP Preceding Page Esc [ Pn V 1 eF
82 PU1 Private Use 1 Esc Q
83 PU2 Private Use 2 Esc R
84 QUAD Typographic Quadding Esc [ Ps Space H 0 FE
85 REP Repeat Char or Control Esc [ Pn b 1
86 RI Reverse Index Esc M FE
87 RIS Reset to Initial State Esc c Fs
88 RM Reset Mode Esc [ Ps l none
89 SD Scroll Down Esc [ Pn T 1 eF
90 SEM Select Edit Extent Mode Esc [ Ps Q 0
91 SGR Select Graphic Rendition Esc [ Ps m 0 FE
92 SL Scroll Left Esc [ Pn Space @ 1 eF
93 SM Select Mode Esc [ Ps h none
94 SPA Start of Protected Area Esc V
95 SPI Spacing Increment Esc [ Pn ; Pn Space G none FE
96 SR Scroll Right Esc [ Pn Space A 1 eF
97 SS2 Single Shift 2 (G2 set) Esc N Intro
98 SS3 Single Shift 3 (G3 set) Esc O Intro
99 SSA Start of Selected Area Esc F
100 ST String Terminator Esc \ Delim
101 STS Set Transmit State Esc S
102 SU Scroll Up Esc [ Pn S 1 eF
103 TBC Tab Clear Esc [ Ps g 0 FE
104 TSS Thin Space Specification Esc [ Pn Space E none FE
105 VPA Vert Position Absolute Esc [ Pn d 1 FE
106 VPR Vert Position Relative Esc [ Pn e 1 FE
107 VTS Vertical Tabulation Set Esc J FE
109 ---------------------------------------------------------------------------
113 Intro an Introducer of some kind of defined sequence; the normal 7-bit
114 X3.64 Control Sequence Introducer is the two characters "Escape ["
118 x/y identifies a character by position in the ASCII table (column/row)
120 eF editor function (see explanation)
122 FE format effector (see explanation)
124 F is a Final character in
125 an Escape sequence (F from 3/0 to 7/14 in the ASCII table)
126 a control sequence (F from 4/0 to 7/14)
128 Gs is a graphic character appearing in strings (Gs ranges from
129 2/0 to 7/14) in the ASCII table
131 Ce is a control represented as a single bit combination in the C1 set
132 of controls in an 8-bit character set
134 C0 the familiar set of 7-bit ASCII control characters
136 C1 roughly, the set of control characters available only in 8-bit systems.
137 This is too complicated to explain fully here, so read Jim Fleming's
138 article in the February 1983 BYTE, especially pages 214 through 224.
140 Fe is a Final character of a 2-character Escape sequence that has an
141 equivalent representation in an 8-bit environment as a Ce-type
142 (Fe ranges from 4/0 to 5/15)
144 Fs is a Final character of a 2-character Escape sequence that is
145 standardized internationally with identical representation in 7-bit
146 and 8-bit environments and is independent of the currently
147 designated C0 and C1 control sets (Fs ranges from 6/0 to 7/14)
149 I is an Intermediate character from 2/0 to 2/15 (inclusive) in the
152 P is a parameter character from 3/0 to 3/15 (inclusive) in the ASCII
155 Pn is a numeric parameter in a control sequence, a string of zero or
156 more characters ranging from 3/0 to 3/9 in the ASCII table
158 Ps is a variable number of selective parameters in a control sequence
159 with each selective parameter separated from the other by the code
160 3/11 (which usually represents a semicolon); Ps ranges from
161 3/0 to 3/9 and includes 3/11
163 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
166 Format Effectors versus Editor Functions
168 A format effector specifies how the final output is to be created.
169 An editor function allows you to modify the specification.
171 For instance, a format effector that moves the "active position" (the
172 cursor or equvalent) one space to the left would be useful when you want to
173 create an overstrike, a compound character made of two standard characters
174 overlaid. Control-H, the Backspace character, is actually supposed to be a
175 format effector, so you can do this. But many systems use it in a
176 nonstandard fashion, as an editor function, deleting the character to the
177 left of the cursor and moving the cursor left. When Control-H is assumed to
178 be an editor function, you cannot predict whether its use will create an
179 overstrike unless you also know whether the output device is in an "insert
180 mode" or an "overwrite mode". When Control-H is used as a format effector,
181 its effect can always be predicted. The familiar characters carriage
182 return, linefeed, formfeed, etc., are defined as format effectors.
184 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
187 ANSI X3.64 Mode-Changing Parameters for use with the
188 Select Mode (SM) and Reset Mode (RM) functions
190 Parameter Mode Mode Function
194 ----------------------------------------------------------------------------
195 3/0 0 an error condition
196 3/1 1 GATM guarded-area transfer mode
197 3/2 2 KAM keyboard action mode
198 3/3 3 CRM control representation mode
199 3/4 4 IRM insertion/replacement mode
200 3/5 5 SRTM status-reporting transfer mode
201 3/6 6 ERM erasure mode
202 3/7 7 VEM vertical editing mode
203 3/8 8 reserved for future standardization
204 3/9 9 reserved for future standardization
205 3/10 : reserved separator for parameters
206 3/11 ; Standard separator for parameters
207 3/12 < reserved for private (experimental) use
208 3/13 = reserved for private (experimental) use
209 3/14 > reserved for private (experimental) use
210 3/15 ? reserved for private (experimental) use
211 3/1 3/0 10 HEM horizontal editing mode
212 3/1 3/1 11 PUM positioning unit mode
213 3/1 3/2 12 SRM send/receive mode
214 3/1 3/3 13 FEAM format effector action mode
215 3/1 3/4 14 FETM format effector transfer mode
216 3/1 3/5 15 MATM multiple area transfer mode
217 3/1 3/6 16 TTM transfer termination mode
218 3/1 3/7 17 SATM selected area transfer mode
219 3/1 3/8 18 TSM tabulation stop mode
220 3/1 3/9 19 EBM editing boundary mode
221 3/1 3/10 1: reserved separator for parameters
222 3/1 3/11 1; Standard separator for parameters
223 3/1 3/12 1< error condition--unspecified recovery
224 3/1 3/13 1= error condition--unspecified recovery
225 3/1 3/14 1> error condition--unspecified recovery
226 3/1 3/15 1? error condition--unspecified recovery
227 3/2 3/0 20 LNM linefeed/newline mode (not in ISO 6429)
230 . . reserved for future standardization
236 . . reserved for private (experimental) use
240 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
243 NOTES ON THE DEC VT100 IMPLEMENTATION
245 In the case of the popular DEC VT100 video-terminal implementation,
246 the only mode that may be altered is the linefeed/newline (LNM) mode.
247 Other modes are considered permanently set, reset, or not applicable
251 Reset: CRM, EBM, FEAM, FETM, IRM, KAM, PUM, SRTM, TSM
252 N/A: GATM, HEM, MATM, SATM, TTM, VEM
254 Control sequences implemented in the VT100 are as follows:
256 CPR, CUB, CUD, CUF, CUP, CUU, DA, DSR, ED, EL, HTS, HVP, IND,
257 LNM, NEL, RI, RIS, RM, SGR, SM, TBC
259 plus several private DEC commands.
261 Erasing parts of the display (EL and ED) in the VT100 is performed thus:
263 Erase from cursor to end of line Esc [ 0 K or Esc [ K
264 Erase from beginning of line to cursor Esc [ 1 K
265 Erase line containing cursor Esc [ 2 K
266 Erase from cursor to end of screen Esc [ 0 J or Esc [ J
267 Erase from beginning of screen to cursor Esc [ 1 J
268 Erase entire screen Esc [ 2 J
270 The VT100 responds to receiving the DA (Device Attributes) control
272 Esc [ c (or Esc [ 0 c)
274 by transmitting the sequence
278 where Ps is a character that describes installed options.
280 The VT100's cursor location can be read with the DSR (Device Status
285 The VT100 reports by transmitting the CPR sequence
289 where Pl is the line number and Pc is the column number (in decimal).
291 \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
294 The complete document describing the standard, "ANSI X3.64-1979:
295 Additional Controls for Use with the American National Standard
296 Code for Information Interchange," can be ordered for $13.50 (plus
299 Standards Sales Department
300 American National Standards Institute
305 It's best to read the full standard before using it. It also helps
306 to have copies of the related standards "X3.4-1977: American
307 National Standard Code for Information Interchange" (the ASCII
308 standard) and "X3.41.1974: Code-Extension Techniques for Use with
309 the 7-Bit Coded Character Set of American National Standard for
310 Information Interchange."
312 See also the chapter "Using Extended Screens and Keyboard Control"
313 in the IBM PC-DOS manuals, especially for the coding for character
316 The specification for the DEC VT100 is document EK-VT100-UG-003.
318 (Copyright 1984 BYTE Publications, subsidiary of McGraw-Hill Inc.)
319 (Permission granted to reproduce for noncommercial uses.)
320 (This file prepared by Richard S. Shuford.)
322 \x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a\x1a