Skip to content

Instantly share code, notes, and snippets.

@bryanjhv
Created February 19, 2021 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanjhv/93fd2521458724a2cc602703fba42c05 to your computer and use it in GitHub Desktop.
Save bryanjhv/93fd2521458724a2cc602703fba42c05 to your computer and use it in GitHub Desktop.
#include <cpuid.h>
#include <stdio.h>
// print CPUID vendor
// using almost plain C
// almost = GCC specific?
int main() {
int a, b, c, d;
__cpuid(0, a, b, c, d);
printf("%.4s%.4s%.4s\n", (char*)&b, (char*)&d, (char*)&c);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment