ÈçºÎÓà DELPHI »ñÈ¡ CPU µÄÐòÁкÅ
ÔÚ¶àCPU»ò¶àºËCPUÖУ¬»áËæ»úµÄ»ñµÃ²»Í¬µÄÐòÁкÅ.Õâ¾ÍΪÎÒÃǸù¾ÝCPUÐòÁкÅÀ´ÖÆ×÷×¢²á»ú´øÀ´Á˺ܴóµÄÂé·³¡£
Windows 2000/XPÔÊÐíÉèÖýø³ÌºÍÏ̵߳ĹØϵ¡£»»¾ä»°Ëµ£¬¿ÉÒÔ¿ØÖÆÄĸö CPU Äܹ»ÔËÐÐijЩÏ̡߳£Õâ³ÆΪAffinity Mask¡£WindowsÌṩÁËÉèÖÃÏàËÆÐԵĺ¯ÊýSetProcessAffinityMask £¬Ê¹ÓÃËü¿É¿ØÖÆ»ñÈ¡Ö¸¶¨CPUµÄÐòÁкš£
1¡¢ÈçºÎ»ñµÃcpuµÄÐòÁкš£
ʹÓÃcpuidÖ¸ÁîÀ´»ñÈ¡¡£
ÔÚµ÷ÓÃCPUID֮ǰ£¬EAXÖдæ·ÅµÄÊǹ¦ÄÜ´úÂë¡£ÔÚµ÷ÓÃCPUIDÖ®ºó£¬EAX,EBX,ECX,EDX´æ·ÅµÄÊÇCPUµÄ¸÷ÖÖÌØÕ÷ÐÅÏ¢¡£ÕâЩÐÅÏ¢Ò²¾ÍÊÇÎÒÃÇͨ³£Ëù˵µÄCPUÐòÁкš£
1¡¢ÈçºÎ»ñµÃcpuµÄÐòÁкÅ?
ÎÒÃÇ¿ÉÒÔʹÓÃʹÓÃCPUIDÖ¸ÁîÀ´»ñÈ¡¡£
ÔÚµ÷ÓÃCPUID֮ǰ£¬EAXÖдæ·ÅµÄÊǹ¦ÄÜ´úÂë¡£ÔÚµ÷ÓÃCPUIDÖ®ºó£¬EAX,EBX,ECX,EDX´æ·ÅµÄÊÇCPUµÄ¸÷ÖÖÌØÕ÷ÐÅÏ¢¡£ÕâЩÐÅÏ¢Ò²¾ÍÊÇÎÒÃÇͨ³£Ëù˵µÄCPUÐòÁкš£
MOV EAX, 0 //»ñÈ¡ÖÆÔìÉÌÐÅÏ¢
CPUID
Mov EAX, 1 //»ñµÃCPUµÄÐòÁкÅ
CPUID
ÏÂÃ潫ÌṩÈý¸öº¯Êý¹©²Î¿¼£º
function NewCPUID: string;
const
CPUINFO = 'CPUÖÆÔìÉÌ: %S ÐòÁкÅ: %x';
var
s: array[0..19] of Char;
MyCpuID: Integer;
begin
FillChar(s, 20, 0);
asm
push ebx
push ecx
push edx
mov eax, 0
cpuid
mov dword ptr s[0], ebx
mov dword ptr s[4], edx
mov dword ptr s[8], ecx
mov eax, 1
cpuid
mov MyCpuID, edx
pop edx
pop ecx
pop ebx
end;
Result := Format(CPUINFO, [s, MyCpuID]);
end;
function GetCPUID: TCPUID; assembler; register;
asm
PUSH EBX {Save affected register}
PUSH EDI
MOV EDI, EAX [email={@Resukt]{@Resukt[/email]}
MOV EAX, 1
DW $A20F {CPUID Command}
STOSD {CPUID[1]}
MOV EAX, EBX
STOSD {CPUID[2]}
MOV EAX, ECX
STOSD {CPUID[3]}
MOV EAX, EDX
STOSD {CPUID[4]}
POP EDI {Restore registers}
POP
Ïà¹ØÎĵµ£º
DelphiÌṩµÄ×Ö·û´®º¯ÊýÀïÓÐÒ»¸öPosº¯Êý£¬ËüµÄ¶¨ÒåÊÇ£º
function Pos(Substr: string; S: string): Integer;
ËüµÄ×÷ÓÃÊÇÔÚ×Ö·û´®SÖвéÕÒ×Ö·û´®Substr£¬·µ»ØÖµÊÇSubstrÔÚSÖеÚÒ»´Î³öÏÖµÄλÖã¬Èç¹ûûÓÐÕÒµ½£¬·µ»ØֵΪ0¡£
ʹÓÃposº¯ÊýÀ´²éÕÒ×Ö·ûµÚÒ»´Î³öÏÖµÄλÖÃ
var
str1:string;
i,j:integer;
begin
str1:='dsf465 ......
¹ØÓÚdelphi Assigned
1.¸ù¾Ý Delphi Ö¸Áî²Î¿¼ÊÖ²áÖÐ
˵Ã÷£º
Assigned º¯Ê½ÔÚ²ÎÊý²»Îªnilʱ´«»ØTrue,±íʾָÕëÒѾָµ½Ä³¸öÄÚ´æµØÖ·£¬Õâ¸öÄÚ´æµØÖ·¿ÉÄÜÊÇÒ»¸ö¶ÔÏóµØÊ×µØÖ·£¬Ò²¿ÉÄÜÔÚº¯Êý»ò¹ý³ÌÖУ¬ÉùÃ÷Ò»¸öÖ¸Õë±äÁ¿£¬Ã»Óи³ÖµÎªnil £¬ÎÞÂÒµÄÖ¸Ïòij´¦£¬ÕâÁ½¸öÖÖÇé¿ö£¬Assigned£¨Ö¸Õë±äÁ¿£©¶¼²»Îªnil , º¯Êý·Å»ØTrue£»
¶ø² ......
VCL¶ÔÏó²»ÊÇḬ̈߳²È«µÄ£¬¶øÇÒËüÃǵÄÊôÐԺͷ½·¨±ØÐëÒª´ÓVCLÖ÷Ïß³ÌÖнøÐзÃÎÊ»ò±»Ö´ÐУ¬µ«ÓÐÁ½ÖÖVCL¶ÔÏóÊÇÀýÍâµÄÇé¿ö£¬ËüÃÇÊÇḬ̈߳²È«µÄ¡£Ò»ÖÖÊÇÈκÎͼÐζÔÏó£¬ÁíÒ»ÖÖÊÇTThreadList¡£
ÕâÒâζ×Ų»±Ø·ÇµÃÔÚÖ÷VCLÏß³ÌÖвÅÄÜÉèÖÃÒ»¸ö»²¼µÄ»±ÊÑÕÉ«£¬»ò»Ë¢ÀàÐÍ£¬¿ÉÒÔÔÚÁíÒ»¸öÏ̵߳Ļ·¾³ÖÐÍê³ÉÒ»µã¡£¶Ô ......
DelphiµÄVCL¿ò¼ÜÔÚ´´½¨Ó¦ÓÃʱTApplicationÊÇÒ»¸ö×Ô¶¯´´½¨µÄÒþ²Ø´°¿Ú£¬ÆäËü´´½¨µÄ´°¿ÚÊÇ×Ô¶¯ÒԸô°¿ÚΪ´°¿Ú£¬Õâ¾Íµ¼Ö´´Ê¼µÄÖ÷´°¿ÚÔÚÈÎÎñÀ¸µÄϵͳ²Ëµ¥Ö»ÓÐÈýÏֻҪÔÚÖ÷´°¿ÚµÄCreateʼþÖн«ÏµÍ³²Ëµ¥ÓÃApplicationµÄϵͳ²Ëµ¥Ìæ»»£¬²¢½«SysCommandÏûϢת·¢µ½Ö÷´°¿Ú¾ÍÕý³£ÁË¡£
unit Unit1;
interface
uses
Windows ......
Æƽⷽ·¨¶¼ÊÇÓÃÁ˺Ð×Ó Delphi.Distiller.v1.85
·Ñ»°²»¶à˵
°²×°ÈÎÒâdelphi 2010 Õýʽ°æ
ÐòÁкÅÊÇ HAAL-DANSGN-FZR5AG-M3BS
°²×°ÍêÖ®ºóµã»÷¿ªÊ¼->Embarcadero RAD Studio 2010 ->Check for update
&nb ......