读cpu id

#include "stdafx.h"
#include <stdio.h>
#include <iostream>

int main()
{
	int buf[4];
	__cpuidex(buf, 01, 0);
	printf("%08x %08x %08x %08x\n", buf[0], buf[1], buf[2], buf[3]);

	memset(buf, 0, sizeof(buf));
	__cpuid(buf, 1);
	printf("%08x %08x %08x %08x", buf[0], buf[1], buf[2], buf[3]);

	getchar();
	return 0;
}

猜你喜欢

转载自blog.csdn.net/SUKHOI27SMK/article/details/82148870