📄 11.htm
字号:
<!-- saved from url=(0022)http://internet.e-mail -->
<html>
<head>
<title>检测CPU的型号 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="195434" alink="195434">
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="621"><a href="http://www.CoDelphi.com"><img src="images/logo.gif" border="0" width="153" height="60"><img src="images/bigbanner.gif" border="0" width="468" height="60"></a></td>
</tr>
</table><br>
<br>
<table width="621" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="left" valign="top" class="font9" height="155">
<div align="center" class="btitle">检测CPU的型号 <br>
<br>
</div>
<div align="center"><strong>CoDelphi.com </strong></div>
<b><br>
摘 要</b>:如何检测CPU的型号 <br>
<b> 关键字</b>:CPU 微处理器 微 处理器 检测 型号 <br>
<b> 类 别</b>:系统控制
<hr size="1" width="100%">
<span class="content">Unit CPUid; <Br><Br>Interface <Br><Br>Type <Br><Br> TCpuType = (cpu8086, cpu286, cpu386, cpu486, cpuPentium); <Br><Br>Function CpuType : TCpuType; <Br>Function CpuTypeString : String; <Br><Br>Implementation <Br><Br>Uses <Br> SysUtils; <Br><Br>Function CpuType : TCpuType; ASSEMBLER; <Br>Asm <Br> // 8086 CPU 检测<Br> push ds <Br> pushf <Br> pop bx <Br> mov ax, 0fffh <Br> and ax, bx <Br> push ax <Br> popf <Br> pushf <Br> pop ax <Br> and ax, 0f000h <Br> cmp ax, 0f000h <Br> mov ax, cpu8086 <Br> je @@End_CpuType <Br><Br> // 80286 CPU检测 <Br><Br> or bx, 0f000h <Br> push bx <Br> popf <Br> pushf <Br> pop ax <Br> and ax, 0f000h <Br> mov ax, cpu286 <Br> jz @@End_CpuType <Br><Br> // 386 CPU 检测<Br><Br> db 66h <Br> pushf <Br> db 66h <Br> pop ax <Br> db 66h <Br> mov cx, ax <Br> db 66h <Br> xor ax, 0h <Br> dw 0004h <Br> db 66h <Br> push ax <Br> db 66h <Br> popf <Br> db 66h <Br> pushf <Br> db 66h <Br> pop ax <Br> db 66h <Br> xor ax, cx <Br> mov ax, cpu386 <Br> je @@End_CpuType <Br><Br> // 486 CPU 检测<Br><Br> db 66h <Br> pushf <Br> db 66h <Br> pop ax <Br> db 66h <Br> mov cx, ax <Br> db 66h <Br> xor ax, 0h <Br> dw 0020h <Br> db 66h <Br> push ax <Br> db 66h <Br> popf <Br> db 66h <Br> pushf <Br> db 66h <Br> pop ax <Br> db 66h <Br> xor ax, cx <Br> mov ax, cpu486 <Br> je @@End_CpuType <Br><Br> // Pentium CPU 检测<Br><Br> db 66h <Br> mov ax, 1 <Br> dw 0 <Br> db 66h <Br> db 0Fh <Br> db 0a2h <Br> db 66h <Br> and ax, 0F00H <Br> dw 0 <Br> db 66h <Br> shr ax, 8 <Br> sub ax, 1 <Br><Br> @@End_CpuType: <Br><Br> pop ds <Br><Br>End; <Br><Br>Function CpuTypeString : String; <Br><Br>Var <Br><Br> Kind : TCpuType; <Br><Br>Begin <Br><Br> Kind := CpuType; <Br><Br> Case Kind Of <Br><Br> cpu8086 : Result := '8086'; <Br> cpu286 : Result := '286'; <Br> cpu386 : Result := '386'; <Br> cpu486 : Result := '486'; <Br> cpuPentium : Result := 'Pentium'; <Br><Br> Else Result := Format ('P%d', [Ord (kind)]); <Br><Br> End; <Br><Br>End; <Br><Br>End.<Br><Br></span>
<table border="0" cellspacing="0" cellpadding="1" class="font9" align="center" width="100%">
<tr align="left" valign="middle" bgcolor="195434">
<td height="1"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#C9C9C6" height="2"></td>
</tr>
</table>
<div align="center"><br>
中文开发在线<a href="http://www.codelphi.com" target="_blank">www.codelphi.com</a>授权使用。
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -