Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. int cmd_ccpuid(char param[])
  3. {
  4. unsigned a, b, c, d;
  5. char str[13];
  6.  
  7. str[12] = '\0';
  8.  
  9. asm ("cpuid" :
  10.                 "=a" (a),
  11.         "=b" (b),
  12.         "=c" (c),
  13.         "=d" (d):
  14.                 "a"(0));
  15.  
  16. str[0] = (b&0x000000ff) >> 0;          
  17. str[1] = (b&0x0000ff00) >> 8;
  18. str[2] = (b&0x00ff0000) >> 16;         
  19. str[3] = (b&0xff000000) >> 24;
  20.  
  21. str[4] = (d&0x000000ff) >> 0;          
  22. str[5] = (d&0x0000ff00) >> 8;
  23. str[6] = (d&0x00ff0000) >> 16;         
  24. str[7] = (d&0xff000000) >> 24;
  25.  
  26. str[8] = (c&0x000000ff) >> 0;          
  27. str[9] = (c&0x0000ff00) >> 8;
  28. str[10] = (c&0x00ff0000)        >> 16;         
  29. str[11] = (c&0xff000000)        >> 24;
  30.  
  31. printf("%s\n\r", str);
  32. return TRUE;
  33. }
  34.