home *** CD-ROM | disk | FTP | other *** search
/ Rat's Nest 1 / ratsnest1.iso / incoming / ansi.lha / ansi364.txt next >
Text File  |  1991-11-06  |  16KB  |  321 lines

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