Skip to content

Instantly share code, notes, and snippets.

@rdeioris
Created January 8, 2019 09:56
Show Gist options
  • Save rdeioris/48f8c72fcb2cc499c05a38eb6a5d9245 to your computer and use it in GitHub Desktop.
Save rdeioris/48f8c72fcb2cc499c05a38eb6a5d9245 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(int argc, char **argv)
{
int part0 = 0;
int part1 = 0;
int part2 = 0;
int part3 = 0;
asm(
"CPUID\r\n"
: "=a"(part0), "=b"(part1), "=c"(part2), "=d"(part3)
: "a"(0)
);
printf("%04X-%04X-%04X-%04X\n", part0, part1, part2, part3);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment