Visual C

Visual C++

If using Visual C++ version 7 or higher, then your compiler has already been updated with the latest and greatest processor information, but if you're using Visual C++ version 6 you need to download and install the service packs from http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp.

You will also need the processor packs if you are running service pack 4, available at http://msdn.microsoft.com/vstudio/downloads/ppack/Beta/download.asp.

If you are using a version older than Visual C++ version 6 you will need to rely heavily on functions that you can call to dump the contents of your registers.

image from book
Figure 21-1: About Visual C++ version 6.0
image from book
Figure 21-2: About Visual C++ .NET version 7.0

You can find out what version of compiler you are using by choosing the About option from the Help menu. In your particular case, your Product ID number will be displayed. For this example, I have erased my numbers from the figures for security.

As you will note in the following Visual C++ dump for an x86 type processor under VC6, only MMX not XMM registers are supported in this example. Since this is from a run using a 3DNow! processor, there is a dump of the MMX registers in hex (MM#) as well as floating-point, denoted by (MM##) in upper and lower 32-bit single-precision floating-point values. MM00 in the bottom portion of Figure 21-3 represents the lower single-precision value of the MM0 register.

image from book
Figure 21-3: Register dump from Visual C++ 6.0(3DNow! extensions)

In some cases, such as an older version of the compiler, the extended registers are not immediately available. In the newer version, such as the VC .NET toolset, that is no longer an issue. As you may notice in

Figure 21-4, selective dumps of the other registers have been made available. Using at least version 7 of the compiler allows the active register sets to be enabled and thus viewed in the window.

image from book
Figure 21-4: Register dump from Visual C++ .NET version 7.0 (3DNow! professional extensions). Note the 3DNow! and SSE supported registers as well as the extra pop-up menu of register type selections that you can choose from. The enabled selections are based upon the processor type running on the computer that is being debugged .

The one thing that you will really need while developing assembly code is a second monitor. This is because you will need lots of screen real estate for all the various windows that you will need for debugging your assembly code.

Since we are talking here about Win32 code, whether it is targeted for the Xbox or PC platforms, then you are most likely dealing with Direct3D or the less likely OpenGL. If it is Direct3D, then it is in your best interest to install the debug versions of the DirectX dynamic-link libraries (DLLs). They will run slower but if something weird happens they will give you more information as to the type of failure. And remember that your application will run that much faster on a retail version of the DLLs.

Tip 

Another handy debugging tool for vectors is the use of multi- colored pens. Using multiple colors on graph paper can produce layered results, giving depth and helping make complex problems easier to understand.

The biggest help in developing vector-based applications above all is the symbolic debugger. The program counter can be followed throughout the code and the general-purpose and SIMD registers monitored . The changes to memory as the results are written can be observed .



32.64-Bit 80X86 Assembly Language Architecture
32/64-Bit 80x86 Assembly Language Architecture
ISBN: 1598220020
EAN: 2147483647
Year: 2003
Pages: 191

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net