getCPUid(很全的)
来源:岁月联盟
时间:2009-06-08
//This unit can be used to detect the cpu model.
unit CpuId;
interface
uses Windows, Mmsystem, Sysutils, Math, Dialogs;
type
TCpuRec=record
Name:string[128];
Vendor:string[12];
Frequency:word;
Family:integer;
Model:integer;
Stepping:integer;
L1DCache:word;
L1ICache:word;
L2Cache:word;
end;
TCpuType = (cpu8086, cpu286, cpu386, cpu486, cpuPentium);
TCpuData=object
function GetCPUIDSupport:Boolean;
function GetVendorString:string;
function GetCPUFrequency:word;
procedure GetFMS(var Family,Model,Stepping:byte);
function GetMaxCpuId:dword;
function CheckFPU:Boolean;
function CheckTSC:Boolean;
function CheckMSR:Boolean;
function CheckMPS:Boolean;
function GetNoCpus:cardinal;
function CheckPN:Boolean;
function CheckCMPXCHG8B:Boolean;
function CheckCMOVe:Boolean;
function CheckSelfSnoop:Boolean;
function CheckDebugTraceStore:Boolean;
function CheckFXSAVEFXRSTOR:Boolean;
function CheckMMX:Boolean;
function CheckMMXplus:Boolean;
function CheckSSE:Boolean;
function CheckSSE2:Boolean;
function CheckAMD3DNow:Boolean;
function CheckAMD3DNowPlus:Boolean;
function GetMaxExtendedFunctions:dword;
procedure GetExtendedFMS(var Family,Model,Stepping:byte);
function GetExtendedCpuName:string;
function GetExtendedL1DCache:word;
function GetExtendedL1ICache:word;
function GetExtendedL2Cache:word;
function CheckCeleron:Boolean;
function CheckPentiumIII:Boolean;
function CheckXeon:Boolean;
function CheckPentium4:Boolean;
function CheckIthanium:Boolean;
function IntelP5N:string;
function IntelP6N:string;
function AMDK5N:string;
function Cyrix686N:string;
function GenericCpuN:string;
function P5CacheL1DI:word;
function P6CacheL1DI:word;
function P6CacheL2:word;
function AuthenticAMD:TCpuRec;
function GenuineIntel:TCpuRec;
function CyrixInstead:TCpuRec;
function GenericCPU:TCpuRec;
end;
const
Intel486:array[0..8] of string=
(Intel 486 DX,
Intel 486 DX,
Intel 486 SX,
Intel 486 DX2,
Intel 486 SL,
Intel 486 SX2,
Intel 486 DX2,
Intel 486 DX4,
Intel 486 DX4);
UMC486:array[0..1] of string=
(UMC U5D,
UMC U5S);
AMD486:array[0..5] of string=
(AMD 486 DX2,
AMD 486 DX2,
AMD 486 DX4,
AMD 486 DX4,
AMD 5x86,
AMD 5x86);
IntelP5:array[0..6] of string=
(Intel Pentium P5 A-Step,
Intel Pentium P5,
Intel Pentium P54C,
Intel Pentium P24T Overdrive,
Intel Pentium MMX P55C,
Intel Pentium P54C,
Intel Pentium MMX P55C);
NexGenNx586=NexGen Nx586;
Cyrix4x86=VIA Cyrix 4x86;
Cyrix5x86=VIA Cyrix 5x86;
CyrixMediaGX=VIA Cyrix Media GX;
CyrixM1=VIA Cyrix 6x86;
CyrixM2=VIA Cyrix 6x86MX;
CyrixIII=VIA Cyrix III;
AMDK5:array[0..3] of string=
(AMD SSA5 (PR75/PR90/PR100),
AMD 5k86 (PR120/PR133),
AMD 5k86 (PR166),
AMD 5k86 (PR200));
AMDK6:array[0..4] of string=
(AMD K6 (166~233),
AMD K6 (266~300),
AMD K6-2,
AMD K6-III,
AMD K6-2+ or K6-III+);
Centaur:array[0..2] of string=
(Centaur C6,
Centaur C2,
Centaur C3);
Rise:array[0..1] of string=
(Rise mP6,
Rise mP6);
IntelP6:array[0..7] of string=
(Intel Pentium Pro A-Step,
Intel Pentium Pro,
Intel Pentium II,
Intel Pentium II,
Intel Pentium II,
Intel Pentium III,
Intel Pentium III,
Intel Pentium III);
AMDK7:array[0..3] of string=
(AMD Athlon(tm) Processor,
AMD Athlon(tm) Processor,
AMD Duron(tm) Processor,
AMD Thunderbird Processor);
IntelP4=Intel Pentium 4;
var CpuData:TCpuData;
implementation
function TCpuData.GetCPUIDSupport:Boolean;
var TempDetect:dword;
begin
asm
pushf
pushfd
push eax
push ebx
push ecx
push edx
pushfd
pop eax
mov ebx,eax
xor eax,$00200000
push eax
popfd
pushfd
pop eax
push ebx
popfd
xor eax,ebx
mov TempDetect,eax
pop edx
pop ecx
pop ebx
pop eax
popfd
popf
end;
GetCPUIDSupport:=(TempDetect=$00200000);
end;
function TCpuData.GetVendorString:string;
var s1,s2,s3:array[0..3] of char;
TempVendor:string;
i:integer;
begin
asm
push eax
push ebx
interface
uses Windows, Mmsystem, Sysutils, Math, Dialogs;
type
TCpuRec=record
Name:string[128];
Vendor:string[12];
Frequency:word;
Family:integer;
Model:integer;
Stepping:integer;
L1DCache:word;
L1ICache:word;
L2Cache:word;
end;
TCpuType = (cpu8086, cpu286, cpu386, cpu486, cpuPentium);
TCpuData=object
function GetCPUIDSupport:Boolean;
function GetVendorString:string;
function GetCPUFrequency:word;
procedure GetFMS(var Family,Model,Stepping:byte);
function GetMaxCpuId:dword;
function CheckFPU:Boolean;
function CheckTSC:Boolean;
function CheckMSR:Boolean;
function CheckMPS:Boolean;
function GetNoCpus:cardinal;
function CheckPN:Boolean;
function CheckCMPXCHG8B:Boolean;
function CheckCMOVe:Boolean;
function CheckSelfSnoop:Boolean;
function CheckDebugTraceStore:Boolean;
function CheckFXSAVEFXRSTOR:Boolean;
function CheckMMX:Boolean;
function CheckMMXplus:Boolean;
function CheckSSE:Boolean;
function CheckSSE2:Boolean;
function CheckAMD3DNow:Boolean;
function CheckAMD3DNowPlus:Boolean;
function GetMaxExtendedFunctions:dword;
procedure GetExtendedFMS(var Family,Model,Stepping:byte);
function GetExtendedCpuName:string;
function GetExtendedL1DCache:word;
function GetExtendedL1ICache:word;
function GetExtendedL2Cache:word;
function CheckCeleron:Boolean;
function CheckPentiumIII:Boolean;
function CheckXeon:Boolean;
function CheckPentium4:Boolean;
function CheckIthanium:Boolean;
function IntelP5N:string;
function IntelP6N:string;
function AMDK5N:string;
function Cyrix686N:string;
function GenericCpuN:string;
function P5CacheL1DI:word;
function P6CacheL1DI:word;
function P6CacheL2:word;
function AuthenticAMD:TCpuRec;
function GenuineIntel:TCpuRec;
function CyrixInstead:TCpuRec;
function GenericCPU:TCpuRec;
end;
const
Intel486:array[0..8] of string=
(Intel 486 DX,
Intel 486 DX,
Intel 486 SX,
Intel 486 DX2,
Intel 486 SL,
Intel 486 SX2,
Intel 486 DX2,
Intel 486 DX4,
Intel 486 DX4);
UMC486:array[0..1] of string=
(UMC U5D,
UMC U5S);
AMD486:array[0..5] of string=
(AMD 486 DX2,
AMD 486 DX2,
AMD 486 DX4,
AMD 486 DX4,
AMD 5x86,
AMD 5x86);
IntelP5:array[0..6] of string=
(Intel Pentium P5 A-Step,
Intel Pentium P5,
Intel Pentium P54C,
Intel Pentium P24T Overdrive,
Intel Pentium MMX P55C,
Intel Pentium P54C,
Intel Pentium MMX P55C);
NexGenNx586=NexGen Nx586;
Cyrix4x86=VIA Cyrix 4x86;
Cyrix5x86=VIA Cyrix 5x86;
CyrixMediaGX=VIA Cyrix Media GX;
CyrixM1=VIA Cyrix 6x86;
CyrixM2=VIA Cyrix 6x86MX;
CyrixIII=VIA Cyrix III;
AMDK5:array[0..3] of string=
(AMD SSA5 (PR75/PR90/PR100),
AMD 5k86 (PR120/PR133),
AMD 5k86 (PR166),
AMD 5k86 (PR200));
AMDK6:array[0..4] of string=
(AMD K6 (166~233),
AMD K6 (266~300),
AMD K6-2,
AMD K6-III,
AMD K6-2+ or K6-III+);
Centaur:array[0..2] of string=
(Centaur C6,
Centaur C2,
Centaur C3);
Rise:array[0..1] of string=
(Rise mP6,
Rise mP6);
IntelP6:array[0..7] of string=
(Intel Pentium Pro A-Step,
Intel Pentium Pro,
Intel Pentium II,
Intel Pentium II,
Intel Pentium II,
Intel Pentium III,
Intel Pentium III,
Intel Pentium III);
AMDK7:array[0..3] of string=
(AMD Athlon(tm) Processor,
AMD Athlon(tm) Processor,
AMD Duron(tm) Processor,
AMD Thunderbird Processor);
IntelP4=Intel Pentium 4;
var CpuData:TCpuData;
implementation
function TCpuData.GetCPUIDSupport:Boolean;
var TempDetect:dword;
begin
asm
pushf
pushfd
push eax
push ebx
push ecx
push edx
pushfd
pop eax
mov ebx,eax
xor eax,$00200000
push eax
popfd
pushfd
pop eax
push ebx
popfd
xor eax,ebx
mov TempDetect,eax
pop edx
pop ecx
pop ebx
pop eax
popfd
popf
end;
GetCPUIDSupport:=(TempDetect=$00200000);
end;
function TCpuData.GetVendorString:string;
var s1,s2,s3:array[0..3] of char;
TempVendor:string;
i:integer;
begin
asm
push eax
push ebx
上一篇:天方夜谭VCL:开门
图片内容
最近更新
随机推荐
- 新氧推四大举措建“正品联盟”,保障
- 一览网络采用讯呼技术电话营销系统提
- 小米影业解散宣发部门 宣布成立一年后
- MS06-043:Microsoft Windows中远程执
- Symantec Altiris Deployment Soluti
- 苹果发布新安全更新 修补Mac OS X浏览
- 思科云火墙战略详解
- 视频网站“邂逅”大数据
- 小米试水微信网购:11月28日开售15万
- Google+风光不再:不再强制用户注册G
- 有缺陷微处理器成为又一安全焦点
- 黑龙江省去年侦破色情诈骗等互联网案
- 支付宝收费,在打什么算盘?
- WarFTPd多个命令处理远程拒绝服务漏洞
- 传百度并购口袋巴士布局移动游戏 收购
- MS05-039:即插即用中允许远程执行代码
- 传统企业,为什么你会经常错失互联网
- 人人快递在上海无任何资格证 涉违法经
- WHD与主机点评网联手 举办行业盛会WH
- 苹果CEO库克向零售店负责人阐述新的i