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

Last reviewed: July 25, 1997
Article ID: Q121368
The information in this article applies to:
  • The Visual Workbench Integrated Debugger included with: - Microsoft Visual C++, 32-bit Edition, version 2.0, 2.1, 4.0 on the

         following platform:
         - x86
    

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");
   }
Keywords          : WBDebug kbhw
Version           : 2.0 2.1 4.0
Platform          : NT WINDOWS
Issue type        : kbprb
Solution Type     : kbworkaround


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.