In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use the ANSI.SYS program. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
ANSI.SYS is a very useful device driver in MS-DOS. With it, we can achieve unexpected display results. So, how should it be used? Let's introduce it.
Note: in this section, uppercase letters in syntax and ANSI escape sequences must be typed as is.
ANSI.SYS defines a series of functions that are used to change display graphics, control cursor movement and redefine keys. ANSI.SYS device drivers support ANSI terminal emulation of escaped sequences in order to control the screen and keyboard of the system.
The device driver must be loaded by a DEVICE or DEVICEHIGH command located in the CONFIG.SYS file.
Grammar
DEVICE (HIGH) = [drive:] [path] ANSI.SYS [/ X] [/ K] [/ R]
Parameters.
[drive:] [path]
Specifies the location of the ANSI.SYS file.
Option
/ X
Remap extension keys other than the 101 key keyboard.
/ K
To make an ANSI.SYS file treat a 101-key keyboard as an 84-key keyboard is equivalent to the command SWITCHES=/K. If you usually use the SWITCHES=/K command, you need to use the option / K when using ANSI.SYS.
/ R
When ANSI.SYS is used with the screen reader, which makes it easier for people with disabilities to use computers, this option is used to adjust the scrolling of lines to improve readability.
Parameters used in the ANSI escape sequence:
A numeric parameter that specifies a decimal number.
Optional parameters. Specifies a decimal number to use to select a function. You can specify multiple functions, and you must separate the arguments with a semicolon (;).
PL
Line parameters. Specifies a decimal number that represents a row on a monitor or other device.
Pc
Column parameters. Specifies a decimal number that represents a column on a screen or other device.
Settings for cursor movement, graphics, and keyboard in the ANSI escape sequence:
In the following list of ANSI escape sequences, the abbreviation ESC stands for the ASCII escape character 27 (1Bh), which is at the beginning of each escape sequence.
ESC [PL;PcH
Cursor position: move the cursor to the specified location (coordinates). If you do not specify a location, the cursor will move to the starting position, that is, the upper-left corner of the screen (0 row, 0 column).
The escape sequence works the same way as the cursor position escape sequence below.
ESC [PL;Pcf
Cursor position: works the same way as the previous cursor position escape sequence.
ESC [PnA
Move the cursor up: moves the cursor up the specified number of rows without changing the column. If the cursor is already on the first line, ANSI.SYS ignores the sequence.
ESC [PnB
Move the cursor down: moves the cursor down the specified number of rows without changing the column. If the cursor is already on the last line, ANSI.SYS ignores the sequence.
ESC [PnC
Move the cursor to the right: moves the cursor to the right the specified number of columns without changing the row. If the cursor is already in the rightmost column, ANSI.SYS ignores the sequence.
ESC [PnD
Move the cursor to the left: moves the cursor to the left the specified number of columns without changing the row. If the cursor is already in the leftmost column, ANSI.SYS ignores the sequence.
ESC [s
Save cursor location: saves the current cursor location. Using the restore cursor position sequence, you can move the cursor to the saved cursor location.
ESC [u
Restore cursor position: returns the cursor position to the location saved by Save cursor position.
ESC [2J
Clear display: clear the screen and move the cursor position to the starting position (0 row, 0 column).
ESC [K
Clear Line: clears all characters (including characters at the cursor position) from the cursor position to the end of the line.
ESC [Ps;...;Psm
Sets the graphics mode: calls the graphics functions specified by the following values, which remain active until the sequence appears again. Graphic mode changes the color and text properties displayed on the screen (for example, boldface and underlined fonts).
Text attribute
Value function
-
0 has no attribute
1 boldface
4 underlined fonts (for monochrome display adapters only)
5 flashing fonts
7 inverted fonts
8 hide fonts
Foreground color
Value function
-
30 black
31 red
32 green
33 yellow
34 Blue
35 purplish red
36 cyan
37 White
Background color
Value function
-
40 black
41 Red
42 Green
43 yellow
44 blue
45 purplish red
46 cyan
47 White
Parameters 30 to 47 conform to the ISO 6429 standard.
ESC [= psh
Set mode: change the screen width or type to one of the following values.
0 40 x 148 x 25 monochrome (text)
1 40 x 148 x 25 Color (text)
2 80 x 148 x 25 monochrome (text)
3 80 x 148 x 25 Color (text)
4 320 x 148 x 200 4 colors (graphics)
5 320 x 148 x 200 monochrome (graphics)
6 640 x 148 x 200 monochrome (graphics)
7 enable line wrapping
13 320 x 148 x 200 colors (graphics)
14 640 x 148 x 200 colors (16-color graphics)
15 640 x 148 x 350 monochrome (2-color graphics)
16 640 x 148 x 350 color (16 color graphics)
17 640 x 148 x 480 monochrome (2-color graphics)
18 640 x 148 x 480 color (16-color graphics)
19 320 x 148 x 200 colors (256 colors)
ESC [= Psl
Reset mode: reset the mode using the same value used in the set Mode sequence, with the exception of 7, which invalidates line wrapping.
Note: the last character in the escape sequence is a lowercase L.
ESC [code;string;...p
Set keyboard string: redefines the keyboard key to the specified string. The parameters of the escape sequence are defined as follows:
"code" is one or more values listed in the following table that represent a combination of keyboard keys and keys. When using these numeric values in a command, you must type the semicolon shown in the table in addition to the semicolon required by the sequence. The code in parentheses does not exist on some keyboards, and ANSI.SYS will not translate the code in parentheses for those keyboards unless the option / X is specified in the ANSI.SYS DEVICE command.
"string" is ASCII code for a single character, or a string enclosed in quotation marks. For example, 65 and "A" are used to represent the capital letter A.
Important: some of the values in the following table are not valid for all computers. For those different values, please check your computer documentation.
Key code SHIFT+ code CTRL+ code ALT+ code
-
F1 0There 59 0There is 84 0There 94 0 is 104.
F 2 0 0 0 x 85 0 10 0 10 5
F 3 0x 61 0 x 86 0 x 96 0 10 6
F4 062 / 0 / 87 / 010 / 97 / 107
F5 0x 63 0 Ten 88 0t 98 0 Ten 108
F6 010 64 0 10 89 0 0 99 0 10 109
F7 010 65 0% 90%% 100% 110%
F8 0x 66 0th 91 0th 101 0t 111
F9 010 / 67 0 / 92 0 / 102 / 0 / 112
F100 010 68 0 10 93 0 x 103 0 10 113
F11 0133 TX 0 Ten 135 0 Ten 137 0 Ten 139
F12 0134 + 0 + + 136 +
A 97 65 1 0
B 98 66 20
C 99 66 3 0
D 100 68 4 0
E 101 69 5 0
F 102 70 60 per se 33
G 103 71 7 0 Ten 34
H 104 72 8 0 Ten 35
I 105 73 9 0
J 106 74 100 th 36
K 107 75 11 0 Ten 37
L 108 76 12 0 Shenzhen 38
M 109 77 13 0
N 110 78 14 0th 49
O 111 79 15 0th 24
P 112 80 16 0 investors 25
Q 113 81 17 0th 16
R 114 82 18 0 Sidney 19
S 115 83 19 0 Ten 31
T 116 84 20 x 20
U 117 85 21 0 investors 22
V 118 86 22 20 * 47
W 119 87 23 0 Ten 17
X 120 88 24 0
Y 121 89 25 0
Z 122 90 26 0 x 44
1 49 33-0 * * 120
2 50 64 00 investors 121
3 51 35-0 * * 122
4 52 36-0 Tencent 123
5 53 37-0 TX 124
6 54 94 300 villages 125
7 55 38-0 TX 126
8 56 42-0 Ten 126
9 57 40-0 * * 127
0 48 41-0 TX 129
-45 95 31 10
= 61 43-- 0 position 131
[91 123 27 0x 26
] 93 125 29 0 position 27
92 124 28 0x 43
; 59 58-0 position 39
'39 34-0 * 40
, 44, 60-- 0-0-51
. 46 62-01052
/ 47 63-0x 53
`96 126-0x 41
Typically, when you press ESC at the DOS prompt, the screen displays a backslash (\) and moves the cursor to the next line. You can use the PROMPT command at this point. If the DOS prompt is now $pinch G, if you want to clear the screen, type: PROMPT=$E [2J $pinch G where $E means press the ESC key, and then change the prompt back to $pinch G, otherwise you will have to clear the screen before executing each command.
You can enter ESC characters in the following ways when editing batch files with EDIT. First press the Ctrl and P keys at the same time, and then press the square brackets, and a left arrow (? Indicates that the ESC character has been entered. After that, you must release Ctrl and press the parenthesis key below to start the ANSI command again.
This is the end of this article on "how to use ANSI.SYS programs". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.