db $0f,$a2 /// cpuid
test edx,$80000000
jz noamd3dnow
mov edx,0
mov tempcheck,edx
noamd3dnow:
pop edx
pop ecx
pop ebx
pop eax
end;
checkamd3dnow:=(tempcheck=0);
end;
function tcpudata.checkamd3dnowplus:boolean;
label noamd3dnowplus;
var tempcheck:dword;
begin
tempcheck:=1;
asm
push eax
push ebx
push ecx
push edx
mov eax,$80000001
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
test edx,$40000000
jz noamd3dnowplus
mov edx,0
mov tempcheck,edx
noamd3dnowplus:
pop edx
pop ecx
pop ebx
pop eax
end;
checkamd3dnowplus:=(tempcheck=0);
end;
function tcpudata.getmaxextendedfunctions:dword;
var tempext:dword;
begin
asm
push eax
push ebx
push ecx
push edx
mov eax,$80000000
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
shl eax,1
shr eax,1
mov tempext,eax
pop edx
pop ecx
pop ebx
pop eax
end;
getmaxextendedfunctions:=tempext;
end;
procedure tcpudata.getextendedfms(var family,model,stepping:byte);
var tempflags:dword;
binflags:array[0..31] of byte;
i,pos:integer;
begin
asm
push eax
push ebx
push ecx
push edx
mov eax,$80000001
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
mov tempflags,eax
pop edx
pop ecx
pop ebx
pop eax
end;
for i:=0 to 31 do
begin
binflags[i]:=tempflags mod 2;
tempflags:=tempflags div 2;
end;
family:=0;
model:=0;
stepping:=0;
pos:=0;
for i:=0 to 3 do
begin
stepping:=stepping+(binflags[pos]*strtoint(floattostr(power(2,i))));
inc(pos);
end;
pos:=4;
for i:=0 to 3 do
begin
model:=model+(binflags[pos]*strtoint(floattostr(power(2,i))));
inc(pos);
end;
pos:=8;
for i:=0 to 3 do
begin
family:=family+(binflags[pos]*strtoint(floattostr(power(2,i))));
inc(pos);
end;
end;
function tcpudata.getextendedcpuname:string;
var s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12:array[0..3] of char;
tempcpuname:string;
i:integer;
begin
asm
push eax
push ebx
push ecx
push edx
mov eax,$80000002
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
mov s1,eax
mov s2,ebx
mov s3,ecx
mov s4,edx
mov eax,$80000003
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
mov s5,eax
mov s6,ebx
mov s7,ecx
mov s8,edx
mov eax,$80000004
mov ebx,0
mov ecx,0
mov edx,0
db $0f,$a2 /// cpuid
mov s9,eax
mov s10,ebx
mov s11,ecx
mov s12,edx
pop edx
pop ecx
pop ebx
pop eax
end;
tempcpuname:='';
for i:=0 to 3 do