I have no idea how should this program work, i found some codes but i don't understand them, if somebody here was so kind and had program like this could you explain it to me?
#include <stdio.h>
#include <string.h>
int main()
{
char name[13];
__asm
{
XOR EAX,EAX
CPUID
MOV dword ptr [name], EBX
MOV dword ptr [name+4], EDX
MOV dword ptr [name+8], ECX
}
name[12]=0;
printf("Procesor: %s\n", name);
getchar();
return 0;
}
The cpuid
instruction tells you various things about the CPU depending on the content of the eax
register. When eax
contains zero, the registers ebx
, edx
, and ecx
contain a string describing the processor's vendor. The code you have pulls the string from the registers and prints it out.
Read Wikipedia for further details on cpuid
.