home *** CD-ROM | disk | FTP | other *** search
-
-
- ██████▄
- ███ ██ ████▄ █▄ ████▄ ██ █▄ █████▄ █████▄ █████▄
- ███ ██ ██ █ ██ ██ ██ ██ ██ █ ██ █ ██
- ███▄▄██ ██ █ ██ ██▄▄ ██ █ ██ ██▄▄▄█ ██▄▄▄█ ██▄▄
- ▓▓▓▓▓▓▓▓▓███░░░▓▓██░░█░██░░▓██░░▓▓██░▓█░▓██░██░░▓█░██░░█░▓██░░▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓ ███ ██▄▄█ ██▄▄ ██▄▄▄ ██▄▄█▄▄██ ██ █ ██ █▄ ██▄▄▄▄ ▓▓
- ▓▓ ▓▓
- ▓▓ PRESENTS ▓▓
- ▓▓ ▓▓
- ▓▓ ANSIT! ANSI driver benchmark ANSI tutorial. ▓▓
- ▓▓ ▓▓
- ▓▓ This file is a small ANSI tutorial to give you the ▓▓
- ▓▓ basics of the ANSI and screen write mechanics. ▓▓
- ▓▓ It's intended for the ANSIT users, not as a general ▓▓
- ▓▓ tutorial. This file only scratches the surface, but ▓▓
- ▓▓ it's enough to make you understand what ANSIT! does. ▓▓
- ▓▓ ▓▓
- ▓▓ Copyright (c) 1992 Steve Danielsson ▓▓
- ▓▓ ▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
-
-
-
-
- OVERVIEW OF THIS FILE
- ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-
- If you have a clear understanding of what an ANSI driver is, what
- it does and how text is written to the screen, you don't really need
- to read this file. This is intended to give some basic technical
- background information concerning this benchmark.
-
- The contents covers Screen write techniques as well as ANSI escape
- sequences. The ANSI driver supplied with DOS is called ANSI.SYS,
- when I'm referring to 'ANSI driver' in this text I mean ANSI.SYS or
- whatever replacement driver you're using.
-
- Note: If you don't know if you have ANSI.SYS loaded, check your
- CONFIG.SYS file, it should include this line
- DEVICE=ANSI.SYS
- or perhaps something like
- DEVICE=C:\DOS\ANSI.SYS
-
-
-
-
-
- SCREEN OUTPUT
- ▄▄▄▄▄▄▄▄▄▄▄▄▄
-
-
- To write text to the screen, MS-DOS calls the ROM BIOS Output
- routines. If an ANSI driver (ANSI.SYS) is installed, the driver
- intercepts the call, interprets the ANSI escape sequences (if any)
- and then calls the ROM BIOS routines.
-
- It's possible to bypass the MS-DOS and BIOS routines by writing
- the text directly to the screen, that is; accessing the hardware.
- A lot of programs do this to get fast screen writes, but DOS
- don't and the drawback is that a program doing this will work
- on IBM Hardware Compatible machines only.
-
- Now, the trouble is that the ROM BIOS I/O routines aren't very
- fast. To get around this someone came up with the idea to write
- an ANSI driver (ANSI.SYS replacement) that did _not_ call the
- ROM BIOS to output text, but bypassed the BIOS routines and
- wrote directly to the screen. This speeds up the text output and
- screen scrolling. Today there are a lot of ANSI.SYS replacements
- doing exactly this.
-
- Another way is to write a Software BIOS, install it as a device
- driver and let it replace the ROM BIOS I/O routines.
- There are some Software BIOS replacements available too.
-
- Obviously, the effectiveness of the routines used to replace
- the ROM BIOS routines depend on how well they are written.
- If you load an ANSI device driver that _does_ take care of
- the output itself you probably won't get a faster output by
- also loading a software BIOS replacement.
-
- Where does the ANSIT benchmark come into all this ?
- Some of the tests performed by ANSIT measure the text output.
- When you run the test you will notice that an ANSI driver
- that uses it's own routines to write to screen rather than
- calling ROM BIOS will be _very_ much faster than drivers that
- don't (for example the original ANSI.SYS).
- Common sense tells us there's no reason to choose an ANSI
- driver that uses the ROM BIOS output routines.
- To find out who wrote the fastest replacement routines, you
- got ANSIT.
-
-
- ANSI ESCAPE SEQUENCES
-
- The reason the ANSI.SYS driver exists is to parse and interpret
- ANSI escape sequences. So what is that ?
-
- American National Standards Institute (ANSI) has approved
- a series of Escape Sequences used to define functions for
- intelligent computer terminals. This was originally intended
- as a "data terminal standard" for mainframe terminals.
- Actually there isn't any terminal in existance that is completely
- ANSI standard (the DEC VT-100 terminal come pretty close, though).
- As usual the dream of standardization is just a dream, the
- equipment manufacturers want to "develop" their products and
- the development make them unique, that is; non-standard.
-
- Movement of the cursor, graphics functions and setting the
- graphics mode are among the functions availible. The two
- first are the ones that concern us here. To make MS/PC-DOS
- machines (somewhat) ANSI compatible, the ANSI driver is loaded.
-
- The ANSI device driver is really a filter between DOS and the
- hardware, intercepting all screen output, searching it for ANSI
- escape sequences, parsing and executing them, if any.
-
- An ANSI escape sequence is a series of characters beginning
- with an Escape (ASCII code 27).
- What the ANSI.SYS driver (or replacement driver) does is to
- interpret these escape sequences and perform the actions or
- functions defined for each sequence.
-
- For example the sequence: ESC [2J is the ANSI sequence to
- clear the screen (called 'ED' = Erase Display).
- The ANSI-driver filters all characters from the keyboard
- (or from STDIN actually) and when an escape sequence is
- encountered, the driver performs the action (in this case,
- clears the screen) instead of writing the escape sequence to
- the screen. DOS reads a file, for example, and sends the text
- in the file to the screen via the ROM BIOS (Binary Input/Output
- System) routines. When the "invisible" ANSI driver finds the
- escape sequence it intercepts it and performs the action defined
- by the ANSI commitee instead of passing the characters on to the
- ROM BIOS.
-
- If you like to see what (and how much) the ANSI driver
- interprets for you, REMark the line in your CONFIG.SYS that
- loads the ANSI driver you're using, reboot your machine and
- try TYPEing the ANSI file included with this program called
- TYPEME.ANS. Since there isn't any ANSI driver to interpret all
- the Escape Sequences in the file, all of them will be written
- to the screen, and it will _not_ look pretty.
- Then, un-REMark the line in CONFIG.SYS, reboot your machine to
- load the ANSI driver again, and try TYPEing the file.
- The result is the interpreted ANSI and the output is alot
- better looking.
-
- A common ANSI escape sequence is the one used to set the text
- and background colors. Think for awhile, every time a color is
- changed on the screen (using ANSI) an escape sequence is sent
- to the driver. The sequence we're talking about (SGR) is 6
- characters long. If the color is changed 30 times in a full
- screen write the driver has to interpret 180 extra characters.
-
- Needless to say, this takes time. The better written the
- interpretation routines are, the faster they will execute.
- MS-DOS original ANSI.SYS is _not_ an example of a well written
- piece of software.
-
- So, someone wrote a faster ANSI-interpreter device than ANSI.SYS
- And then someone else wrote an even faster... this is called
- development. To help you determine which ANSI device driver is the
- fastest, you have ANSIT!
-
-
-
- NON STANDARD ANSI ESCAPE SEQUENCES
-
- There are some ANSI.SYS replacement drivers that can handle,
- interpret, some extended, non-standard, escape sequences.
- These are often an extension to the ANSI capability to define
- function keys etcetera. You may or may not have use for them.
- If you don't they only make the device driver bigger, taking up
- more of your RAM. No extended set of sequences can make the
- standard ANSI handling go faster.
-
-
-
- PUTTING IT ALL TOGETHER
-
- Now, considering the above, if you have an ANSI device driver
- installed that both uses the slow ROM BIOS I/O routines and
- is itself slow at interpreting the ANSI escape sequences, you
- do have a slow screen output. You can do much better!
- An example of a device driver of this kind is the ANSI.SYS.
- If you use it, get another ANSI-driver !!!
-
- Using one that has fast ANSI interpretation _and_ uses it's
- own (hopefully well-written) routines instead of ROM BIOS will
- obviously give you the fastest screen writes and ANSI handling.
-
- Before you start benchmarking every ANSI-driver in sight, keep
- this in mind:
-
- * The ANSI escape sequence handling affects animated ANSI files or
- any application which uses ANSI escape sequences to change the
- colors of the text or/and background, moves the cursor and so on.
- This is measured by ANSIT, Test 1 and Test 3 in particular.
-
- * The BIOS or replacement output routines affects anything written
- to the screen using BIOS writes. It does _not_ affect applications
- writing directly to the screen by accessing the hardware.
- This includes all DOS output, TYPE'ing of text files and all
- programs using BIOS to output text. Screen scrolling in particular
- is affected!
- This is measured by ANSI Test 2, Test 4 and Test 5.
-
- As mentioned before, this tutorial only gives you a basic knowledge.
- There's a lot more to ANSI than this.
- This, however, is all you need to know unless you have a special
- interest in the subject. For a more detailed technical information,
- refer to the Microsoft/IBM technical reference or any good litterature
- concerning the ANSI terminal standard. The ANSI escape sequences that
- ANSI.SYS interprets is listed in detail in the MS-DOS manual.
-
-
- I hope this file has helped anyone on their way to understanding
- ANSI, if it does, it was worth the time writing it.
- The file is intended to help ANSIT! users to understand what the
- benchmark tests, but if you have gained a general knowledge on what
- the ANSI driver does, so much the better.
-
- Any error in this file is my fault only.
- If you find one, whether it's a result of misspelling or
- misunderstanding. Please do not change the text, write me a Netmail
- about it and I'll release an updated file.
-
- Steve Danielsson, Stockholm, 1992.
-