Delphi7中插入汇编[Assembly]獲取CPUIDunit Unit1;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUIDinterface
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUIDuses
Delphi7中插入汇编[Assembly]獲取CPUID  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Delphi7中插入汇编[Assembly]獲取CPUID  Dialogs, StdCtrls;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
type
Delphi7中插入汇编[Assembly]獲取CPUID  TCPUID
=array[1..4of Longint;
Delphi7中插入汇编[Assembly]獲取CPUID  TVendor
=array [0..11of char;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
type
Delphi7中插入汇编[Assembly]獲取CPUID  TForm1 
= class(TForm)
Delphi7中插入汇编[Assembly]獲取CPUID    Edit1: TEdit;
Delphi7中插入汇编[Assembly]獲取CPUID    Label1: TLabel;
Delphi7中插入汇编[Assembly]獲取CPUID    Button1: TButton;
Delphi7中插入汇编[Assembly]獲取CPUID    
procedure Button1Click(Sender: TObject);
Delphi7中插入汇编[Assembly]獲取CPUID  private
Delphi7中插入汇编[Assembly]獲取CPUID    
{ Private declarations }
Delphi7中插入汇编[Assembly]獲取CPUID  public
Delphi7中插入汇编[Assembly]獲取CPUID    
{ Public declarations }
Delphi7中插入汇编[Assembly]獲取CPUID  
end;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
const
Delphi7中插入汇编[Assembly]獲取CPUID  ID_BIT 
= $200000;  //CPU ID 專用變量  EFLAGS ID bit
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
var
Delphi7中插入汇编[Assembly]獲取CPUID  Form1: TForm1;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION IsCPUID_Available : BOOLEAN; register;
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION GetCPUID : TCPUID; assembler; register;
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION GetCPUVendor : TVendor; assembler; register;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID                                                     
Delphi7中插入汇编[Assembly]獲取CPUIDimplementation
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
{$R *.dfm}
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
// CPU ID ==================================================
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION IsCPUID_Available : BOOLEAN; register;
Delphi7中插入汇编[Assembly]獲取CPUIDasm
Delphi7中插入汇编[Assembly]獲取CPUID  PUSHFD        
{direct access to flags no possible, only via stack}
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EAX        
{flags to EAX}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EDX,EAX    
{save current flags}
Delphi7中插入汇编[Assembly]獲取CPUID  XOR     EAX,ID_BIT    
{not ID bit}
Delphi7中插入汇编[Assembly]獲取CPUID  PUSH    EAX        
{onto stack}
Delphi7中插入汇编[Assembly]獲取CPUID  POPFD            
{from stack to flags, WITH not ID bit}
Delphi7中插入汇编[Assembly]獲取CPUID  PUSHFD        
{back to stack}
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EAX        
{get back to EAX}
Delphi7中插入汇编[Assembly]獲取CPUID  XOR     EAX,EDX    
{check IF ID bit affected}
Delphi7中插入汇编[Assembly]獲取CPUID  JZ      @exit        
{no, CPUID not availavle}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     AL,TRUE    
{Result=TRUE}
Delphi7中插入汇编[Assembly]獲取CPUID  @exit:
Delphi7中插入汇编[Assembly]獲取CPUIDEND;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION GetCPUID : TCPUID; assembler; register;
Delphi7中插入汇编[Assembly]獲取CPUIDasm
Delphi7中插入汇编[Assembly]獲取CPUID  PUSH    EBX         
{Save affected register}
Delphi7中插入汇编[Assembly]獲取CPUID  PUSH    EDI
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EDI,EAX     
{@Resukt}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,
1
Delphi7中插入汇编[Assembly]獲取CPUID  DW      $A20F       
{CPUID Command}
Delphi7中插入汇编[Assembly]獲取CPUID  STOSD              
{CPUID[1]}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,EBX
Delphi7中插入汇编[Assembly]獲取CPUID  STOSD               
{CPUID[2]}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,ECX
Delphi7中插入汇编[Assembly]獲取CPUID  STOSD               
{CPUID[3]}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,EDX
Delphi7中插入汇编[Assembly]獲取CPUID  STOSD               
{CPUID[4]}
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EDI          
{Restore registers}
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EBX
Delphi7中插入汇编[Assembly]獲取CPUIDEND;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUIDFUNCTION GetCPUVendor : TVendor; assembler; register;
Delphi7中插入汇编[Assembly]獲取CPUIDasm
Delphi7中插入汇编[Assembly]獲取CPUID  PUSH    EBX          
{Save affected register}
Delphi7中插入汇编[Assembly]獲取CPUID  PUSH    EDI
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EDI,EAX     
{@Result (TVendor)}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,
0
Delphi7中插入汇编[Assembly]獲取CPUID  DW      $A20F          
{CPUID Command}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,EBX
Delphi7中插入汇编[Assembly]獲取CPUID  XCHG      EBX,ECX     
{save ECX result}
Delphi7中插入汇编[Assembly]獲取CPUID  MOV      ECX,
4
Delphi7中插入汇编[Assembly]獲取CPUID@
1:
Delphi7中插入汇编[Assembly]獲取CPUID  STOSB
Delphi7中插入汇编[Assembly]獲取CPUID  SHR     EAX,
8
Delphi7中插入汇编[Assembly]獲取CPUID  LOOP    @
1
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,EDX
Delphi7中插入汇编[Assembly]獲取CPUID  MOV      ECX,
4
Delphi7中插入汇编[Assembly]獲取CPUID@
2:
Delphi7中插入汇编[Assembly]獲取CPUID  STOSB
Delphi7中插入汇编[Assembly]獲取CPUID  SHR     EAX,
8
Delphi7中插入汇编[Assembly]獲取CPUID  LOOP    @
2
Delphi7中插入汇编[Assembly]獲取CPUID  MOV     EAX,EBX
Delphi7中插入汇编[Assembly]獲取CPUID  MOV      ECX,
4
Delphi7中插入汇编[Assembly]獲取CPUID@
3:
Delphi7中插入汇编[Assembly]獲取CPUID  STOSB
Delphi7中插入汇编[Assembly]獲取CPUID  SHR     EAX,
8
Delphi7中插入汇编[Assembly]獲取CPUID  LOOP    @
3
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EDI         
{Restore registers}
Delphi7中插入汇编[Assembly]獲取CPUID  POP     EBX
Delphi7中插入汇编[Assembly]獲取CPUIDEND;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
//==============================================================================
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
procedure TForm1.Button1Click(Sender: TObject);
Delphi7中插入汇编[Assembly]獲取CPUID
var cpuid:TCPUID; i:integer;
Delphi7中插入汇编[Assembly]獲取CPUID
begin
Delphi7中插入汇编[Assembly]獲取CPUID  
if IsCPUID_Available then begin
Delphi7中插入汇编[Assembly]獲取CPUID    edit1.text:
='';
Delphi7中插入汇编[Assembly]獲取CPUID    cpuid:
=GetCPUID;
Delphi7中插入汇编[Assembly]獲取CPUID    
//CPUIDStr:=GetCPUVendor+'_';
Delphi7中插入汇编[Assembly]獲取CPUID    
for i:=1 to 4 do edit1.text:=edit1.text+IntToHex(CPUID[i],4);
Delphi7中插入汇编[Assembly]獲取CPUID  
end else edit1.text:='CPUID_IS_NOT_AVAILABLE';
Delphi7中插入汇编[Assembly]獲取CPUID
end;
Delphi7中插入汇编[Assembly]獲取CPUID
Delphi7中插入汇编[Assembly]獲取CPUID
end.
Delphi7中插入汇编[Assembly]獲取CPUID

相关文章:

  • 2021-08-10
  • 2022-01-27
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2021-05-16
  • 2021-08-05
  • 2021-11-08
  • 2022-03-09
  • 2022-12-23
相关资源
相似解决方案