Created
January 8, 2012 19:23
-
-
Save mikeb01/1579376 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
static void cpuid(int op1, int op2, int *data) { | |
asm("cpuid" | |
: "=a" (data[0]), "=b" (data[1]), "=c" (data[3]), "=d" (data[2]) | |
: "a"(op1), "c"(op2)); | |
} | |
int main(int argc, char** argv) { | |
int values[5]; | |
cpuid(0, 0, values); | |
printf("Vendor String: %s\n", (char*) &values[1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment