我有段取CPU ID 的代码,我要问该ID是否会经常变动???(10分)

H

hamsoft

Unregistered / Unconfirmed
GUEST, unregistred user!
我的一软件中使用了机器号,实际上是取CPU的ID,三年来一直很正常,但这几天有人说
该ID每次开机或休眠后都会不同,机器是DELL的。我想是不可能,因为ID会变动的话就失
去意义了,CPU厂家就无须把该功能写入芯片。
代码如下:
function GetCPUID: TCPUID; assembler; register;
asm
PUSH EBX {Save affected register}
PUSH EDI
MOV EDI,EAX {@Resukt}
MOV EAX,1
DW $A20F {CPUID Command}
STOSD {CPUID[1]}
MOV EAX,EBX
STOSD {CPUID[2]}
MOV EAX,ECX
STOSD {CPUID[3]}
MOV EAX,EDX
STOSD {CPUID[4]}
POP EDI {Restore registers}
POP EBX
end;
 
应该不会,但为什么不到那台机器上做实地测试呢?
 
检测CPU的型号
CoDelphi.com


摘 要:如何检测CPU的型号
关键字:CPU 微处理器 微 处理器 检测 型号
类 别:系统控制


CoDelphi.com版权所有,未经允许,不得进行任何形式转载


Unit CPUid;

Interface

Type
TCpuType = (cpu8086, cpu286, cpu386, cpu486, cpuPentium);

Function CpuType : TCpuType;
Function CpuTypeString : String;

Implementation

Uses
SysUtils;

Function CpuType : TCpuType; ASSEMBLER;
Asm
// 8086 CPU 检测
push ds
pushf
pop bx
mov ax, 0fffh
and ax, bx
push ax
popf
pushf
pop ax
and ax, 0f000h
cmp ax, 0f000h
mov ax, cpu8086
je @@End_CpuType
// 80286 CPU检测
or bx, 0f000h
push bx
popf
pushf
pop ax
and ax, 0f000h
mov ax, cpu286
jz @@End_CpuType
// 386 CPU 检测
db 66h
pushf
db 66h
pop ax
db 66h
mov cx, ax
db 66h
xor ax, 0h
dw 0004h
db 66h
push ax
db 66h
popf
db 66h
pushf
db 66h
pop ax
db 66h
xor ax, cx
mov ax, cpu386
je @@End_CpuType
// 486 CPU 检测
db 66h
pushf
db 66h
pop ax
db 66h
mov cx, ax
db 66h
xor ax, 0h
dw 0020h
db 66h
push ax
db 66h
popf
db 66h
pushf
db 66h
pop ax
db 66h
xor ax, cx
mov ax, cpu486
je @@End_CpuType
// Pentium CPU 检测
db 66h
mov ax, 1
dw 0
db 66h
db 0Fh
db 0a2h
db 66h
and ax, 0F00H
dw 0
db 66h
shr ax, 8
sub ax, 1
@@End_CpuType:
pop ds

End;

Function CpuTypeString : String;

Var
Kind : TCpuType;

Begin
Kind := CpuType;
Case Kind Of
cpu8086 : Result := '8086';
cpu286 : Result := '286';
cpu386 : Result := '386';
cpu486 : Result := '486';
cpuPentium : Result := 'Pentium';
Else Result := Format ('P%d', [Ord (kind)]);
End;

End;

End.

 
1、那个人不在本地,我没法证明。
2、检测CPU的型号对我来说没用,因为我的代码是取CPU的ID,由CPUID来产生机器号。
跟286 386等无关。
 
不好意思哦,我是一个超级菜鸟,只能给你提供这么一篇文章了!
 
今天用户有来信说,两台笔记本电脑产生的CUPID中,CPUID[1]、CPUID[4]完全一样,更绝
的是两台都一样的毛病,有时是387F9FF,有时是383F9FF,是用户撒谎(再要一个注册码)
还是该PC有问题?
 
不可能!
 
用户说有,我又得不到证实,查找了很多CPUID也没得到确切的消息,烦!三年没人说有此
情况。就一个,那人还说能解决就解决,不能就算了。好像是我的错,我骗注册费似的,
其实10元能干什么?还不够电话费、电费,更不用说工资了。
 
呵呵,没办法
 
P-III才有cpuid啊,难道你的程序不给人家是P-II的用啊
还有,cmos设置里面可以设置禁止取得cpuid的,
设置了禁止之后,或者是用了P-II我觉得得到的数据就不确定了
 
CPUID 不是P3才有的。我的Cyrix pro200也有ID
我的代码见上,你是dfw no.1 应该知道的码。
另外,cmos设置禁止的好像跟我这个CPUID无关吧?是CPU序列号
从我的注册用户很多来看,对于你的答复,我是:
“恭喜你,你答错了,下次再努力”(小丫语)
 
嘻嘻,我又不是超人,不可能什么都知道的嘛
 
顶部