Sometimes we want DOS to display different colors or have some other functions. If we load ANSI.SYS when DOS starts, it can help us achieve these functions. Below is how to use it:
------------------------------
How to Use ANSI.SYS
ANSI.SYS is a very useful device driver in MS-DOS. With it, we can get display effects we would not normally expect. So how should it be used? Let me introduce it below.
Note: In this section, the uppercase letters in the syntax and ANSI escape sequences must be typed exactly as shown.
ANSI.SYS defines a series of functions used to change display graphics, control cursor movement, and redefine keys. The ANSI.SYS device driver supports ANSI terminal emulation for escape sequences, so as to control the system's screen and keyboard.
This device driver must be loaded by the DEVICE or DEVICEHIGH command located in the CONFIG.SYS file.
Syntax
DEVICE(HIGH)=ANSI.SYS
Parameters
Specifies the location of the ANSI.SYS file.
Options
/X
Remaps extended keys other than those on a 101-key keyboard.
/K
Makes the ANSI.SYS file treat a 101-key keyboard as an 84-key keyboard. This is equivalent to the command SWITCHES=/K. If you normally use the
SWITCHES=/K command, then when using ANSI.SYS, you need to use the /K option.
/R
When ANSI.SYS is used together with a screen reader (a program that makes computers easier to use for disabled people), this option adjusts line scrolling to improve readability.
Parameters used in ANSI escape sequences:
Pn
Numeric parameter, used to specify a decimal number.
Ps
Optional parameter. Specifies a decimal number used to select a function. You may specify multiple functions, and the parameters must be separated by semicolons (
.
PL
Line parameter. Specifies a decimal number representing a line on the display or other device.
Pc
Column parameter. Specifies a decimal number representing a column on the screen or other device.
Cursor movement, graphics, and keyboard settings in ANSI escape sequences:
In the list of ANSI escape sequences below, the abbreviation ESC stands for ASCII escape character 27(1Bh), which appears at the start of each escape sequence.
ESC
93 125 29 0;27
92 124 28 0;43
; 59 58 -- 0;39
' 39 34 -- 0;40
, 44 60 -- 0;51
. 46 62 -- 0;52
/ 47 63 -- 0;53
` 96 126 -- 0;41
Normally, when you press the ESC key at the DOS prompt, the screen will display a backslash (\) and move the cursor to the next line. At this time you can use the PROMPT command. Suppose the current DOS prompt is $P$G. If you want to clear the screen, you can type:
PROMPT=$E
------------------------------
How to Use ANSI.SYS
ANSI.SYS is a very useful device driver in MS-DOS. With it, we can get display effects we would not normally expect. So how should it be used? Let me introduce it below.
Note: In this section, the uppercase letters in the syntax and ANSI escape sequences must be typed exactly as shown.
ANSI.SYS defines a series of functions used to change display graphics, control cursor movement, and redefine keys. The ANSI.SYS device driver supports ANSI terminal emulation for escape sequences, so as to control the system's screen and keyboard.
This device driver must be loaded by the DEVICE or DEVICEHIGH command located in the CONFIG.SYS file.
Syntax
DEVICE(HIGH)=ANSI.SYS
Parameters
Specifies the location of the ANSI.SYS file.
Options
/X
Remaps extended keys other than those on a 101-key keyboard.
/K
Makes the ANSI.SYS file treat a 101-key keyboard as an 84-key keyboard. This is equivalent to the command SWITCHES=/K. If you normally use the
SWITCHES=/K command, then when using ANSI.SYS, you need to use the /K option.
/R
When ANSI.SYS is used together with a screen reader (a program that makes computers easier to use for disabled people), this option adjusts line scrolling to improve readability.
Parameters used in ANSI escape sequences:
Pn
Numeric parameter, used to specify a decimal number.
Ps
Optional parameter. Specifies a decimal number used to select a function. You may specify multiple functions, and the parameters must be separated by semicolons (
.PL
Line parameter. Specifies a decimal number representing a line on the display or other device.
Pc
Column parameter. Specifies a decimal number representing a column on the screen or other device.
Cursor movement, graphics, and keyboard settings in ANSI escape sequences:
In the list of ANSI escape sequences below, the abbreviation ESC stands for ASCII escape character 27(1Bh), which appears at the start of each escape sequence.
ESC
93 125 29 0;27
92 124 28 0;43
; 59 58 -- 0;39
' 39 34 -- 0;40
, 44 60 -- 0;51
. 46 62 -- 0;52
/ 47 63 -- 0;53
` 96 126 -- 0;41
Normally, when you press the ESC key at the DOS prompt, the screen will display a backslash (\) and move the cursor to the next line. At this time you can use the PROMPT command. Suppose the current DOS prompt is $P$G. If you want to clear the screen, you can type:
PROMPT=$E
欢迎大家观临我的个人主页:
http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/
EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/
EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------



