Code comments:
Code:
asm("push eax;"
"push ebx;"
"push ecx;"
"push edx;"
"mov eax, 0;"
"cpuid;"
"mov [_CPUVendor], ebx;"
"mov [_CPUVendor + 4], edx;"
"mov [_CPUVendor + 8], ecx;"
"mov [_CPUSignature], eax;");
No need to save registers. MS compiler figures out what registers you use and save them for you.
I personally would write a simple function that gets you a, b, c and d as DWORD's from CPUID function x, e.g something like this [syntax of storing a, b, c and d is possibly faulty]
Code:
void getcpuid(DWORD func, DWORD *a, DWORD *b, DWORD *c, DWORD *d)
{
__asm("mov eax, func;"
"cpuid;"
"mov b, ebx;"
"mov d, edx;"
"mov c, ecx;"
"mov a, eax;");
}
--
Mats