Cooler_

Is 64 bit ?

May 22nd, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   unsigned int code = 0x80000001;
  6.   unsigned int a, b, c, d;
  7.  
  8.   __asm__ volatile ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "a"(code));
  9.   if(d&(1<<29))
  10.     puts("he 64 bit");
  11.   else
  12.     puts("nao he 64 bit");
  13.  return (0);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment