Sunday 13 November 2011

Which method is better, ANSI functions or BIOS functions? in C programming

Which method is better, ANSI functions or BIOS functions?

Each method has its advantages and disadvantages. What you must do is answer a few questions to find out which method is right for the application you need to create. Do you need to get your application out quickly? Is it just a “proof of concept” or the “real thing”? Does speed matter? Do you need the approval of your inner child? OK, so maybe your inner child doesn’t care, but the other questions should be answered before you decide. The following list compares the basic advantages of ANSI versus BIOS functions:

ANSI Advantages over BIOS
It requires only printf() statements to perform tasks
You can easily change text color and attributes
It works on every PC, regardless of configuration
You don’t need to memorize BIOS functions

BIOS Advantages over ANSI
It runs faster
You can do more things using BIOS
It does not require a device driver (ANSI requires ANSI.SYS)
You don’t need to memorize ANSI commands

What you will discover is that ANSI is a good place to start, and it will enable you to create some nice programs. However, you will probably find that ANSI begins to “get in your way,” and you’ll soon want to move on to BIOS functions. Of course, you’ll also find that the BIOS gets in your way sometimes, and you’ll want to go even faster. For example, FAQ XIV.4 contains an example of avoiding even the BIOS to print text to the screen. You’ll probably find that this method is more fun than ANSI or BIOS.

Cross Reference:

XIV.4: How can I access important DOS memory locations from my program?

No comments:

Post a Comment