使用Visual C++编程取得CPU信息(3)
char OEMString[13];
int iEAXValue,iEBXValue,iECXValue,iEDXValue;
_asm {
mov eax,0
cpuid
mov DWORD PTR OEMString,ebx
mov DWORD PTR OEMString+4,edx
mov DWORD PTR OEMString+8,ecx
mov BYTE PTR OEMString+12,0
}
cout< < "This CPU 's OEM String is:"< < OEMString< < endl;
_asm {
mov eax,1
cpuid
mov iEAXValue,eax
mov iEBXValue,ebx
mov iECXValue,ecx
mov iEDXValue,edx
}
if(iEDXValue&0x800000)
cout < < "This is MMX CPU"< < endl;
else
cout < < "None MMX Support."< < endl;
int iCPUFamily=(0xf00 & iEAXValue) > >8;
cout < < "CPU Family is:"< < iCPUFamily< < endl;
_asm{
mov eax,2
CPUID
}
if(_AL==1)
cout < < "Pentium Pro or Pentium II Found";
getch();
return 0;
}
- 上一篇:使VC显示jpg gif图像
- 下一篇:深度解析VC中的消息(下)