To begin, we will focus on mathematical calculations. Virtually all applications use some operations connected with mathematical calculations, ranging from the simplest ones (such as addition and subtraction), to solving the systems of equations. The mathematical operations may use both the ordinary CPU commands such as ADD , SUB , MUL , DIV , and the specialized commands of the Floating-Point Unit (FPU).
Arithmetic commands of any microprocessor are a thing of special concern. Arithmetic calculations using these types of commands can be found in virtually any application. This group of commands, though not very numerous , performs most of the data conversion operations in the processor. In practice, arithmetic commands make up only a fraction of all executable commands, but their performance is specific.
The Visual C++ .NET 2003 programming environment is noted for its varied powerful mathematical functions. But the C++ mathematical libraries are based on a relatively simple set of the CPU and FPU commands. Assembly language does not contain such ready-made complex functions and libraries, but it allows you to develop your own, some of which may be even better than those in C++.
Here, we will consider aspects of using assembly language for optimizing calculation algorithms. The greatest optimization possibilities lie in the correct use of the floating-point operations. Developers may often create their own assembly functions that have greater calculation power and higher efficiency than the similar C++ library functions. As a rule, such functions are needed for real-time data processing solutions, and also in creating device drivers and system services.
In order to implement these tasks successfully, it is necessary to have a fairly good background in the system of commands and FPU operation peculiarities in the Intel processors.