Microsoft KB Archive/121368

= PRB: VC++ Debugger Won't Support Pentium-Specific Instructions =

Q121368

-

The information in this article applies to:


 * The Visual Workbench Integrated Debugger
 * *EDITOR Please do not choose this product*Microsoft Visual C++ 32-bit Edition* use 241, 265, 225, versions 2.0, 2.1, 4.0

-

SYMPTOMS
The Disassembly window of the Visual Workbench Integrated Debugger does not display the correct information for modules containing Pentium-specific (P5) instructions. These instructions may be displayed as '???', and may cause assembly instructions that follow the Pentium-specific instruction to be displayed incorrectly.

CAUSE
The Visual C++ debugger does not support Pentium instructions in the disassembly window.

MORE INFORMATION
While the compiler supports Pentium optimizations (/G5), it does not support generating Pentium-specific instructions. This problem will usually occur only with tools such as the Microsoft Macro Assembler, which does support Pentium instructions.

The following sample code demonstrates the problem by using the CPUID command. Because the compiler and inline assembler won't generate this instruction directly, the __asm _emit instruction is used to insert the opcode directly into the code.

Sample Code
NOTE: The following sample code contains a Pentium-specific instruction. It should only be run on Pentium processors. The program generates unhandled exception if running on non-Pentium family processors.     /* Compile options needed: Visual Workbench default options for *                        debug build. */

#include 

void main (void) {  int CPUType;

_asm { _emit 0x0f  ; CPUID (00001111 10100010) - This is a Pentium ; specific instruction which gets information on the _emit 0xa2  ; processor. A Pentium family processor should set ; bits 11-8 of eax to 5.

mov CPUType, eax ; Move result of CPUID to CPU variable }

CPUType = (CPUType >> 8) & 0x000f;

if (CPUType == 5) printf("This is a Pentium family processor.\n"); else printf("This is not a Pentium family processor.\n"); } Additional query words:

Keywords : kbhw kbDebug kbide kbHardware

Issue type : kbprb

Technology :

Last Reviewed: July 30, 2001

-

[mailto:MSDN@MICROSOFT.COM Send feedback to Microsoft]

© 2002 Microsoft Corporation. All rights reserved.