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

ID: Q121368


The information in this article applies to:
  • The Visual Workbench Integrated Debugger
    • Microsoft Visual C++ 32-bit Edition, 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 <stdio.h>

   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
Version :
Platform : NT WINDOWS
Issue type : kbprb


Last Reviewed: January 31, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.