#include <conio.h>
#include <iostream>
#pragma hdrstop
#pragma inline
//#pragma argsused
using namespace std;
int main()
{
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;
int iCPUFamily = (0xf00 & iEAXValue) >> 8;
cout << "CPU Family is:"
<< iCPUFamily
<< endl;
_asm
{
mov eax, 2
cpuid
}
return 0;
}