ID: Q121368
The information in this article applies to:
following platform:
- x86
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.
The Visual C++ debugger does not support Pentium instructions in the disassembly window.
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.
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 : kbhw kbDebug kbide
Version : 2.0 2.1 4.0
Platform : NT WINDOWS
Issue type : kbprb
Last Reviewed: July 27, 1997