delphi 取cpu号

从网上找的取cpu号 在d7中测试通过了 push,move,pop 。。。有点难 

现在的水平我也就只能拿来主义了

/// <summary>
/// 取cpu号
/// </summary>
/// <returns></returns>
function TForm1.GetCPUID: string;
var
_eax, _ebx, _ecx, _edx: Longword;
s, s1, s2: string;
begin
asm
push eax
push ebx
push ecx
push edx
mov eax,1
db $0F,$A2
mov _eax,eax
mov _ebx,ebx
mov _ecx,ecx
mov _edx,edx
pop edx
pop ecx
pop ebx
pop eax
end;
s := IntToHex(_eax, 8);
s1 := IntToHex(_edx, 8);
s2 := IntToHex(_ecx, 8);
result := s + s1 + s2;
end;

原文地址:https://www.cnblogs.com/SoftWareIe/p/4432840.html