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.

获取CPU序列号的Delphi程序的更多相关文章

  1. C# 获取CPU序列号、网卡MAC地址、硬盘序列号封装类,用于软件绑定电脑

    using System.Management; namespace GLaLa { /// <summary> /// hardware_mac 的摘要说明. /// </summ ...

  2. C#获取cpu序列号 硬盘ID 网卡硬地址以及操作注册表 .

    转:http://blog.csdn.net/smartsmile2012/article/details/8682295 #region 获取cpu序列号 硬盘ID 网卡硬地址 /**/ /// & ...

  3. 获取硬盘序列号的Fortran程序

    以前写了个获取硬盘序列号的fortran程序,但未经实证 program FortranDemo Use Kernel32 Implicit None Interface SUBROUTINE Get ...

  4. 获取CPU序列号、网卡MAC地址、硬盘序列号

    <pre name="code" class="csharp"> using System; using System.Collections; u ...

  5. C# 中获取CPU序列号/网卡mac地址

    1.cpu序列号2.mac序列号3.硬盘id在给软件加序列号时这三个应该是最有用的,可以实现序列号和机器绑定,对保护软件很有好处.哈哈.   using System; using System.Ma ...

  6. Java获取CPU序列号

    获取CPU序列号 /** * 获取CPU序列号 * @return */ public static String getCpuId() throws IOException { Process pr ...

  7. 几个获取Windows系统信息的Delphi程序

    1.获取windows版本信息 可以通过Windows API函数GetVersionEx来获得. 具体程序如下: Procedure Tform1.Button1Click(sender:TObje ...

  8. 获取 CPU 序列号

    function GetCpuID: string; var _eax, _ebx, _ecx, _edx: Longword; s, s1, s2: string; begin asm push e ...

  9. 获取CPU序列号

    public string GetCPUSerialNo() { string cpuSerialNo = string.Empty; ManagementClass managementClass ...

随机推荐

  1. Linux上的文件查找工具之locate与find

    前言 Linux上提供了两款工具用于查找文件,一款是locate,另一款是find. locate的特点是根据已生成的数据库查找,速度较快,但是查找的是快照数据,不准确. 因此在日常使用中,为了准确性 ...

  2. 翻转长方形 (不知名oj中一道个人私题)--单调栈维护最大子矩形

    怎么分析这道题呢? 首先 ,我们注意到一点: 不管怎么操作,任意一个2*2方格中的 "#"个数的奇偶性是不变的. 所以,如果一个2*2方格中有奇数个"#",这个 ...

  3. 2018-6-20-随笔-SQL Server中乱码

    SQL Server中乱码解决方案: 在Sql Server2005英文版中,如果未对Varchar类型的字段进行设置,那么很多朋友会发现向数据库中插入记录时,如果对应的varchar类型字段 的值为 ...

  4. sql关于对一个字段同时满足多条件判断来筛选查询

    表所有数据 查询userName为abc或xyz的 以下为本菜鸟项目中遇到的问题: 背景: /**  * wangjie 180629  *   * 学生需要查询四种可能的消息  * 1.班级管理员发 ...

  5. java获取一年的周数和间隔天数

    java获取一年的周数和间隔天数 import java.text.ParseException; import java.text.SimpleDateFormat; import java.uti ...

  6. mongodb更新数组元素中的字段,数组$占位符

    pppCodes为数组,PPPCode,expiredOn为数组元素中的字段 db.getCollection('users').findOneAndUpdate({ _id: userId, 'pp ...

  7. make、makefile、cmake、qmake对比

    作者:玟清链接:https://www.zhihu.com/question/27455963/answer/36722992来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出 ...

  8. BZOJ4095 : [Usaco2013 Dec]The Bessie Shuffle

    首先将排列和整个序列以及询问都反过来,问题变成给定一个位置$x$,问它经过若干轮置换后会到达哪个位置. 每次置换之后窗口都会往右滑动一个,因此其实真实置换是$p[i]-1$. 对于每个询问,求出轮数, ...

  9. C++程序设计方法1:分离代码

    使用头文件,分离声明与定义 防止重复包含: #ifndef FUNC_H #define FUNC_H .... #endif main函数的命令行参数: #include <iostream& ...

  10. day3字典_字符串_文件操作

    一.知识回顾 1.jmeter怎样增加压力机:在主控机配置文件 jmeter.perperties 文件中添加对应压力的IP和对应端口,多台压力机IP用","隔开,保证所有负载机和 ...