----------------------------------------------------
sysinfo.h
#include
extern "C" __declspec(dllexport) int __stdcall getCPUFamily());
---------------------------------------------------------------------
sysinfo.cpp
#include "SysInfo.h"
extern "C" __declspec(dllexport) int __stdcall getCPUFamily() {
int retVal;
//This is how to use assembly code
_asm {
mov eax, 1
cpuid
mov retVal, eax
}
return (retVal >> 8);
}
No comments:
Post a Comment