«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to retrieve the CPU vendor ID

   

Here is a little assembly code routine that shows how to retrieve the computer's CPU vendor ID.

function GetCPUVendor: string;
var
  aVendor: array [0 .. 2] of LongWord;
  iI, iJ: Integer;
begin
  asm
    push  ebx
    xor   eax, eax
    dw    $A20F // CPUID instruction
    mov   LongWord ptr aVendor, ebx
    mov   LongWord ptr aVendor[+4], edx
    mov   LongWord ptr aVendor[+8], ecx
    pop   ebx
  end;
  for iI := 0 to 2 do
    for iJ := 0 to 3 do
      Result := Result +  
        Chr((aVendor[iI] and ($000000ff shl(iJ * 8))) shr(iJ * 8));
end;
Author: Unknown
Contributor: Bill Miller
Added: 2014-01-22
Last updated: 2014-01-22

« Return to contents »