I'm trying to read the cpuid information with the following cod but it doesn't work. I'm using Visual Studio 2010:
#include "stdafx.h"
#include <stdio.h>
int main()
{
int a, b;
for (a = 0; a < 5; a++)
{
__asm__("cpuid"
:"=a"(b) // EAX into b (output)
:"0"(a) // a into EAX (input)
:"%ebx","%ecx","%edx"); // clobbered registers
printf("The code %i gives %i\n", a, b);
}
return 0;
}
This is what it say:
'project_scs.exe': Loaded 'C:\Users\myUser\Documents\Visual Studio 2010\Projects\project_scs\Debug\project_scs.exe', Symbols loaded.
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped).
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.
'project_scs.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The thread 'Win32 Thread' (0x2190) has exited with code -1073741510 (0xc000013a).
The program '[8828] project_scs.exe: Native' has exited with code -1073741510 (0xc000013a).
Can anyone tell what to do to make it run? Thanks