get CPU id (很全的)[7]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 ypyrock 的 blog

   tempcpuname:=tempcpuname+s1[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s2[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s3[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s4[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s5[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s6[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s7[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s8[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s9[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s10[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s11[i];
  for i:=0 to 3 do
   tempcpuname:=tempcpuname+s12[i];
  getextendedcpuname:=tempcpuname;
end;
function tcpudata.getextendedl1dcache:word;
var l1d,templ1d:dword;
    binarray:array[0..31] of byte;
    i,p:integer;
begin
asm
  push eax
  push ebx
  push ecx
  push edx
  mov eax,$80000005
  mov ebx,0
  mov ecx,0
  mov edx,0
  db $0f,$a2               /// cpuid
  mov l1d,ecx
  pop edx
  pop ecx
  pop ebx
  pop eax
end;
for i:=0 to 31 do
  begin
   binarray[i]:=l1d mod 2;
   l1d:=l1d div 2;
  end;
templ1d:=0;
p:=0;
for i:=24 to 31 do
  begin
   templ1d:=templ1d+(binarray[i]*strtoint(floattostr(power(2,p))));
   inc(p);
  end;
getextendedl1dcache:=templ1d;
end;
function tcpudata.getextendedl1icache:word;
var l1i,templ1i:dword;
    binarray:array[0..31] of byte;
    i,p:integer;
begin
asm
  push eax
  push ebx
  push ecx
  push edx
  mov eax,$80000005
  mov ebx,0
  mov ecx,0
  mov edx,0
  db $0f,$a2               /// cpuid
  mov l1i,edx
  pop edx
  pop ecx
  pop ebx
  pop eax
end;
for i:=0 to 31 do
  begin
   binarray[i]:=l1i mod 2;
   l1i:=l1i div 2;
  end;
templ1i:=0;
p:=0;
for i:=24 to 31 do
  begin
   templ1i:=templ1i+(binarray[i]*strtoint(floattostr(power(2,p))));
   inc(p);
  end;
getextendedl1icache:=templ1i;
end;
function tcpudata.getextendedl2cache:word;
var l2,templ2:dword;
    binarray:array[0..31] of byte;
    i,p:integer;
begin
asm
  push eax
  push ebx
  push ecx
  push edx
  mov eax,$80000006
  mov ebx,0
  mov ecx,0
  mov edx,0
  db $0f,$a2               /// cpuid
  mov l2,ecx
  pop edx
  pop ecx
  pop ebx
  pop eax
end;
for i:=0 to 31 do
  begin
   binarray[i]:=l2 mod 2;
   l2:=l2 div 2;
  end;
templ2:=0;
p:=0;
for i:=16 to 31 do
  begin
   templ2:=templ2+(binarray[i]*strtoint(floattostr(power(2,p))));
   inc(p);
  end;
getextendedl2cache:=templ2;
end;
function tcpudata.checkceleron:boolean;
var bid:byte;
begin
asm
  push eax
  push ebx
  push ecx
  push edx
  mov eax,1
  db $0f,$a2               /// cpuid
  mov bid,bl
  pop edx
  pop ecx
  pop ebx
  
  pop eax
end;
checkceleron:=(bid=$1);
end;
function tcpudata.checkpentiumiii:boolean;
var bid:byte;
begin
if checkmmx and checksse then checkpentiumiii:=true
else checkpentiumiii:=false;
end;
function tcpudata.checkxeon:boolean;
var bid:byte;
begin
asm
  push eax
  push ebx
  push ecx
  push edx

本文关键:delphi cpu id
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top