Atlas - ANSI.DOC

Home / ext / JunkDrawer / DOS / BuildTools / v2.0 Lines: 1 | Size: 6784 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1This document explains the how the ANSI escape sequences are 2defined for the IBM PC. 3 4Notes: 5 61. The default value is used when no explicit value is given 7 or a value of zero is given. 8 92. Pn - Numeric parameter. A decimal number specified 10 with ASCII digits. 11 123. Ps - Selective parameter. Any decimal number that is 13 is used to select a subfunction. Multiple subfunctions 14 may be selected by separating the parameters with 15 semi-colons. 16 17C U R S O R F U N C T I O N S 18 19CUP - Cursor Postion 20 21 ESC [ Pl ; Pc H 22 23HVP - Horizontal & Vertical Postion 24 25 ESC [ Pl ; Pc f 26 27 CUP and HVP move the cursor to the position specified by 28the parameters. The first parameter specifies the line number 29and the second parameter specifies the column number. The 30default value is one. When no parameters are given the cursor 31is moved to the home postion. 32 33CUU - Cursor Up 34 35 ESC [ Pn A 36 37 Moves the cursor up one line without changing columns. The 38value of Pn determines the number of lines moved. The default 39value for Pn is one. This sequence is ignored if the cursor 40is already on the top line. 41 42CUD - Cursor Down 43 44 ESC [ Pn B 45 46 Moves the cursor down one line without changing columns. 47The value of Pn determines the number of lines moved. The 48default value for Pn is one. This sequence is ignored if the 49cursor is already on the bottom line. 50 51CUF - Cursor Forward 52 53 ESC [ Pn C 54 55 Moves the cursor forword one column without changing lines. 56The value of Pn determines the number of columns moved. The 57default value for Pn is one. This sequence is ignored if the 58cursor is already in the rightmost column. 59 60 ESC [ Pn D 61 62Moves the cursor back one column without changing lines. The 63value of Pn determines the number of columns moved. The default 64value for Pn is one. This sequence is ignored if the cursor 65is already in the leftmost column. 66 67DSR - Device Status Report 68 69 ESC [ 6 n 70 71The console driver will output a CPR sequence on receipt of 72DSR. 73 74CPR - Cursor Position Report (from console driver to system) 75 76 ESC [ Pn ; Pn R 77 78 The CPR sequence reports current cursor position via 79standard input. The first parameter specifies the current 80line and the second parameter specifies the current column. 81 82SCP - Save Cursor Postion 83 84 ESC [ s 85 86 The current cursor position is saved. This cursor position 87can be restored with the RCP sequence. 88 89RCP - Restore cursor position 90 91 ESC [ u 92 93 Restores the cursor position to the value it had when the 94console driver received the SCP sequence. 95 96E R A S I N G 97 98ED - Erase Display 99 100 ESC [ 2 J 101 102Erases all of the screen and the cursor goes to the home 103position. 104 105EL - Erase Line 106 107 ESC [ K 108 109 Erases from the cursor to the end of the line and includes 110the cursor position. 111 112 113 114M O D E S O F O P E R A T I O N 115 116SGR - Set Graphics Rendition 117 118 ESC [ Ps ; ... ; Ps m 119 120Invokes the graphic rendition specified by the parameter(s). 121All following characters are rendered according to the 122parameter(s) until the next occurence of SGR. 123 124Parameter Parameter Function 125 126 0 All Attributes Off 127 1 Bold On 128 4 Underscore On (monochrome displays 129 only) 130 5 Blink On 131 7 Reverse Video On 132 8 Concealed On (ISO 6429 standard) 133 30 Black foreground (ISO 6429 standard) 134 31 Red foreground (ISO 6429 standard) 135 32 Green foreground (ISO 6429 standard) 136 33 Yellow foreground (ISO 6429 standard) 137 34 Blue foreground (ISO 6429 standard) 138 35 Magenta foreground (ISO 6429 standard) 139 36 Cyan foreground (ISO 6429 standard) 140 37 White foregound (ISO 6429 standard) 141 40 Black background (ISO 6429 standard) 142 41 Red background (ISO 6429 standard) 143 42 Green background (ISO 6429 standard) 144 43 Yellow background (ISO 6429 standard) 145 44 Blue background (ISO 6429 standard) 146 45 Magenta background (ISO 6429 standard) 147 46 Cyan background (ISO 6429 standard) 148 47 White backgound (ISO 6429 standard) 149 150SM - Set Mode (IBM/MICROSOFT Private) 151 152 ESC [ = Ps h 153or ESC [ = h 154or ESC [ = 0 h 155or ESC [ ? 7 h 156 157 158Invokes the screen width or type specified by the parameter. 159 160Parameter Parameter Function 161 162 0 40 x 25 black and white 163 1 40 x 25 color 164 2 80 x 25 black and white 165 3 80 x 25 color 166 167 4 320 x 200 color 168 5 320 x 200 black and white 169 6 640 x 200 black and white 170 7 wrap at end of line 171 172 173RM - Reset Mode 174 175 ESC [ = Ps l 176or ESC [ = l 177or ESC [ = 0 l 178or ESC [ ? 7 l 179 180 181 Parameters are the same as SM (Set Mode) except that 182parameter 7 will reset wrap at end of line mode. 183 184 185K E Y B O A R D R E - A S S I G N M E N T 186 187Although not part of the ANSI 3.64-1979 or ISO 6429 standard 188the IBM PC keyboard re-assignment was done in a compatible 189way. 190 191The control sequence is: 192 193 ESC [ Pn ; Pn ; ... Pn p 194or ESC [ "string" ; p 195or ESC [ Pn ; "string" ; Pn ; Pn ; "string" ; Pn p 196or any other combination of strings and decimal numbers 197 198The final code in the control sequence ("p") is one reserved 199for private use the by ANSI 3.64-1979 standard. 200 201The first ASCII code in the control sequence defines which 202code is being mapped. The remaining numbers define the 203sequence of ASCII codes generated when this key is 204intercepted. 205 206To every rule there is an exception, however! If the first 207code in the sequence is zero (NUL) then the first and second 208code make up an extended ASCII re-definition. 209 210Here are some examples: 211 2121. Reassign the Q and q key to the A and a key (and the other 213 way as well): 214 215 ESC [ 6 5 ; 8 1 p A becomes Q 216 ESC [ 9 7 ; 1 1 3 p a becomes q 217 ESC [ 8 1 ; 6 5 p Q becomes A 218 ESC [ 1 1 3 ; 9 7 p q becomes a 219 2202. Reassign the F10 key to to a dir command followed by a 221 carriage return: 222 223 ESC [ 0 ; 6 8 ; " d i r " ; 1 3 p 224 225 The 0;68 is the extended ASCII code for the F10 key. 13 226 decimal is a carriage return 227
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.