delphi4arab منتديات دلفي للعرب

نسخة كاملة : معرفة معلومات عن المعالج في الجهاز
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
PHP كود :
unit main;

interface

uses
 Windows
MessagesSysUtilsClassesGraphicsControlsFormsDialogs,
 
StdCtrlsExtCtrlsButtons;

type
 Tform1 
= class(TForm)
    
img_infoTImage;
    
Image1TImage;
    
BitBtn1TBitBtn;
   
procedure FormShow(SenderTObject);
 private
   { Private 
declarations }
 public
   { Public 
declarations }
   
procedure info(s1s2string);
 
end;

var
 
form1tform1;
 
gn_speed_yInteger;
 
gn_text_yInteger;
const
 
gn_speed_xInteger 8;
 
gn_text_xInteger  15;
 
gl_startBoolean   True;

implementation

{$R *.DFM}

procedure Tform1.FormShow(SenderTObject);
var
 
_eax_ebx_ecx_edxLongword;
 
iInteger;
 
bByte;
 
b1Word;
 
ss1s2s3s_allstring;
begin
 
//Set the startup colour of the image
img_info.Canvas.Brush.Color := clblue;
img_info.Canvas.FillRect(rect(00img_info.Widthimg_info.Height));


 
gn_text_y := 5//position of the 1st text

 
asm                //asm call to the CPUID inst.
   
mov eax,0         //sub. func call
   
db $0F,$A2         //db $0F,$A2 = CPUID instruction
   
mov _ebx,ebx
   mov _ecx
,ecx
   mov _edx
,edx
 end
;

 for 
:= 0 to 3 do   //extract vendor id
 
begin
   b 
:= lo(_ebx);
   
:= chr(b);
   
:= lo(_ecx);
   
s1:= s1 chr(b);
   
:= lo(_edx);
   
s2:= s2 chr(b);
   
_ebx := _ebx shr 8;
   
_ecx := _ecx shr 8;
   
_edx := _edx shr 8;
 
end;
 
info('CPU''');
 
info('   - ' 'Vendor ID: 's2 s1);

 
asm
   mov eax
,1
   db 
$0F,$A2
   mov _eax
,eax
   mov _ebx
,ebx
   mov _ecx
,ecx
   mov _edx
,edx
 end
;
 
//06B1
 //|0000| |0000 0000| |0000| |00| |00| |0110| |1011| |0001|
 
:= lo(_eax) and 15;
 
info('   - ' 'Stepping ID: 'IntToStr(b));
 
:= lo(_eaxshr 4;
 
info('   - ' 'Model Number: 'IntToHex(b1));
 
:= hi(_eax) and 15;
 
info('   - ' 'Family Code: 'IntToStr(b));
 
:= hi(_eaxshr 4;
 
info('   - ' 'Processor Type: 'IntToStr(b));
 
//31.   28. 27.   24. 23.   20. 19.   16.
 //  0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0
 
:= lo((_eax shr 16)) and 15;
 
info('   - ' 'Extended Model: 'IntToStr(b));

 
:= lo((_eax shr 20));
 
info('   - ' 'Extended Family: 'IntToStr(b));

 
:= lo(_ebx);
 
info('   - ' 'Brand ID: 'IntToStr(b));
 
:= hi(_ebx);
 
info('   - ' 'Chunks: 'IntToStr(b));
 
:= lo(_ebx shr 16);
 
info('   - ' 'Count: 'IntToStr(b));
 
:= hi(_ebx shr 16);
 
info('   - ' 'APIC ID: 'IntToStr(b));

 
//Bit 18 =? 1     //is serial number enabled?
 
if (_edx and $40000) = $40000 then
   info
('   - ' 'Serial Number ''Enabled')
 else
   
info('   - ' 'Serial Number ''Disabled');

 
:= IntToHex(_eax8);
 
asm                  //determine the serial number
   
mov eax,3
   db 
$0F,$A2
   mov _ecx
,ecx
   mov _edx
,edx
 end
;
 
s1 := IntToHex(_edx8);
 
s2 := IntToHex(_ecx8);
 
Insert('-'s5);
 
Insert('-'s15);
 
Insert('-'s25);
 
info('   - ' 'Serial Number: ''-' s1 '-' s2);

 
asm
   mov eax
,1
   db 
$0F,$A2
   mov _edx
,edx
 end
;
 
info('''');
 
//Bit 23 =? 1
 
if (_edx and $800000) = $800000 then
   info
('MMX ''Supported')
 else
   
info('MMX ''Not Supported');

 
//Bit 24 =? 1
 
if (_edx and $01000000) = $01000000 then
   info
('FXSAVE & FXRSTOR Instructions ''Supported')
 else
   
info('FXSAVE & FXRSTOR Instructions Not ''Supported');

 
//Bit 25 =? 1
 
if (_edx and $02000000) = $02000000 then
   info
('SSE ''Supported')
 else
   
info('SSE ''Not Supported');

 
//Bit 26 =? 1
 
if (_edx and $04000000) = $04000000 then
   info
('SSE2 ''Supported')
 else
   
info('SSE2 ''Not Supported');

 
info('''');

 
asm     //execute the extended CPUID inst.
   
mov eax,$80000000   //sub. func call
   
db $0F,$A2
   mov _eax
,eax
 end
;

 if 
_eax > $80000000 then  //any other sub. funct avail. ?
 
begin
   info
('Extended CPUID: ''Supported');
   
info('   - Largest Function Supported: 'IntToStr(_eax - $80000000));
   
asm     //get brand ID
     
mov eax,$80000002
     db 
$0F
     db $A2
     mov _eax
,eax
     mov _ebx
,ebx
     mov _ecx
,ecx
     mov _edx
,edx
   end
;
   
s  := '';
   
s1 := '';
   
s2 := '';
   
s3 := '';
   for 
:= 0 to 3 do
   
begin
     b 
:= lo(_eax);
     
s3:= s3 chr(b);
     
:= lo(_ebx);
     
:= chr(b);
     
:= lo(_ecx);
     
s1 := s1 chr(b);
     
:= lo(_edx);
     
s2 := s2 chr(b);
     
_eax := _eax shr 8;
     
_ebx := _ebx shr 8;
     
_ecx := _ecx shr 8;
     
_edx := _edx shr 8;
   
end;

   
s_all := s3 s1 s2;

   
asm
     mov eax
,$80000003
     db 
$0F
     db $A2
     mov _eax
,eax
     mov _ebx
,ebx
     mov _ecx
,ecx
   mov _edx
,edx
   end
;
   
s  := '';
   
s1 := '';
   
s2 := '';
   
s3 := '';
   for 
:= 0 to 3 do
   
begin
     b 
:= lo(_eax);
     
s3 := s3 chr(b);
     
:= lo(_ebx);
     
:= chr(b);
     
:= lo(_ecx);
     
s1 := s1 chr(b);
     
:= lo(_edx);
     
s2 := s2 chr(b);
     
_eax := _eax shr 8;
     
_ebx := _ebx shr 8;
     
_ecx := _ecx shr 8;
     
_edx := _edx shr 8;
   
end;
   
s_all := s_all s3 s1 s2;

   
asm
     mov eax
,$80000004
     db 
$0F
     db $A2
     mov _eax
,eax
     mov _ebx
,ebx
     mov _ecx
,ecx
     mov _edx
,edx
   end
;
   
s  := '';
   
s1 := '';
   
s2 := '';
   
s3 := '';
   for 
:= 0 to 3 do
   
begin
     b  
:= lo(_eax);
     
s3 := s3 chr(b);
     
:= lo(_ebx);
     
:= chr(b);
     
:= lo(_ecx);
     
s1 := s1 chr(b);
     
b  := lo(_edx);
     
s2 := s2 chr(b);
     
_eax := _eax shr 8;
     
_ebx := _ebx shr 8;
     
_ecx := _ecx shr 8;
     
_edx := _edx shr 8;
   
end;
   
info('Brand String: ''');
   if 
s2[Length(s2)] = #0 then setlength(s2, Length(s2) - 1);
   
info('''   - ' s_all s3 s1 s2);
 
end
 
else
   
info('   - Extended CPUID ''Not Supported.');
end;

procedure Tform1.info(s1s2string);
begin
 
if s1 <> '' then
 begin
   img_info
.Canvas.Brush.Color := clblue;
   
img_info.Canvas.Font.Color  := clyellow;
   
img_info.Canvas.TextOut(gn_text_xgn_text_ys1);
 
end;
 if 
s2 <> '' then
 begin
   img_info
.Canvas.Brush.Color := clblue;
   
img_info.Canvas.Font.Color  := clWhite;
   
img_info.Canvas.TextOut(gn_text_x img_info.Canvas.TextWidth(s1), gn_text_ys2);
 
end;
 
Inc(gn_text_y13);
end;

end
اخي انت عقدتها كثيرا على ما اضن فقط
انا احتجت سحب المعلومات عن الجهاز
استعملت الرجيسري
كماتعلم يحوي جميع المعلوماات
كذلك يسهل العملبه من خلال الدلفي
أخي العزيز الملومات التي يمكن الحصول عليها بواسطة الكود السابق لا يمكن الحصول عليها من خلال مسجل النظام والحقيقة هو الأمر معقد قليلاً .. وإذا كنت قد طبقت الكود السابق كنت أدركت صحة كلامي .. فالمعلومات التي يقدمها الكود السابق هي ما يعطيها البيوس عن المعالج بشكل صحيح ودقيق.


وفقك الله .
أنا أوافق الأخ issamdnn تماما فى الرأى
لا يجب إطلاقا الوثوق فى محرر السجل فى هذا الخصوص
كثيرا ما يتلاعب بائع نصاب بتلك القيم بغرض الغش
إستخلاص المواصفة من البيوس أضمن

و إن أمكنك أخى ضع المشروع كاملا
شكرا شباب على المعلومات القيمة
اجل البيوس لا يمكن التلاعب به
لهذا هو ادق
جميل جدا بارك الله بيك اخي العزيز