Get information on CPU

zhaozj2021-02-16  49

#include #include

#pragma hdrstop # prgma 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, EBX MOV IEbxValue, EBX MOV IECXVALUE, ECX MOV IEDXVALUE, EDX}

IE (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;}

转载请注明原文地址:https://www.9cbs.com/read-20662.html

New Post(0)