Thursday, November 18, 2010

Pin It


Get Gadget

How To Find Your Processor Brand String


CPUID function in x86 Assembly Language


CPUID is an instruction provided by processor manufacture, it is an Assembly instruction. It has no operands in its function call. But it takes arguments from AX register. It provides processor identification information in registers EAX, EBX, ECX, and EDX. This information identifies Intel as the vendor, gives the family, model, and stepping of processor, feature information, and cache information. An input value loaded into the EAX register determines what information is returned. There is list of AX register values which retunes different information about CPU.



EAX=0h, CPUID

This returns the CPU's manufacturer ID string - a twelve character ASCII string stored in EBX, EDX, ECX - in that order. The highest basic calling parameter is returned in EAX. EBX, EDX, ECX, EAX are 32bit registers. We can store 4 8bit characters. Here is a example values of registers after CPUID call.

EAX= Maximum Input Value for Basic CPUID Information (see second table)
EBX= "Genu"
ECX= "ntel"
EDX= "ineI"

EAX=80000002h,80000003h,80000004h, CPUID

These return the processor brand string in EAX, EBX, ECX and EDX. CPUID must be issued with each parameter in sequence to get the entire 48-byte null-
terminated ASCII processor brand string.

EAX=80000002h;
EAX=” ”
EBX=” ”
ECX=” “
EDX= "nI "
EAX=80000003h;
EAX= "(let"
EBX= "P )R"
ECX= "itne"
EDX= "R(mu"
EAX=80000003h;
EAX= " 4 )"
EBX= " UPC"
ECX= "0051"
EDX= "zHM"

Hear also you have to write assembly codes to set AX value and call CPUID and extract data from registers and print them. Do it iteratively four times to get the processor brand string.

1 comment: