Research Experience -------> CPU information acquisition, comprehensive

Source: Internet
Author: User
I recently sorted out a copy of CPU information, which should be comprehensive.
Almost all X86 CPUs now have built-in CPUID commands to identify authenticity. Some CPU vendors such as AMD and VIA also have built-in extended CPUID commands, making it easier to use.
Next we use Delphi to implement a CPU detection software.
CPUID is called as follows:
Asm
Push eax
Push ebx
Push ecx
Push edx
Mov eax, X
//************************************** ****************
// Cpuid command, because the compilation compiler of Delphi does not have the built-in command,
// Use the machine language code $ 0F, $ A2 to implement this command.
//************************************** ****************
Db $ 0F, $ A2
Pop edx
Pop ecx
Pop ebx
Pop eax
End;
The CPUID command parameter is EAX, mov eax, and X, which is to assign X to EAX.
The returned parameters are stored in EAX, EBX, ECX, and EDX.
We can write a function:
Type
TCPUIDResult = record
EAX: DWord;
EBX: DWord;
ECX: DWord;
EDX: DWord;
End;
......
Function CPUID (EAX: DWord): TCPUIDResult;
Asm
Push eax
Push ebx
Push ecx
Push edx
Mov eax, EAX
//************************************** ****************
// Cpuid command, because the compilation compiler of Delphi does not have the built-in command,
// Use the machine language code $ 0F, $ A2 to implement this command.
//************************************** ****************
Db $ 0F, $ A2
Mov Result. EAX, EAX
Mov Result. EBX, EBX
Mov Result. ECX, ECX
Mov Result. EDX, EDX
Pop edx
Pop ecx
Pop ebx
Pop eax
End;
CPUID parameter and return value list:
EAX = pai_1_h
Enter EAX = 0000_1_h to obtain the maximum value supported by the CPUID command and the name string of the manufacturer.
Output EAX = xxxx_xxxxh to obtain the maximum value supported by the CPUID command #1
EBX-EDX-ECX manufacturer name string #2
GenuineIntel Intel processor
UMC processor
AuthenticAMD processor
CyrixInstead Cyrix processor
NexGenDriven NexGen processor
CentaurHauls Centaur processor
RiseRiseRise Rise Technology processor
GenuineTMx86 Transmeta processor
Geode by NSC National semiconduprocessor
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.