grab processor name

Discussion in 'Programming General' started by mu-b, Jun 25, 2009.

grab processor name
  1. Unread #1 - Jun 25, 2009 at 11:09 PM
  2. mu-b
    Joined:
    Jun 24, 2009
    Posts:
    1,353
    Referrals:
    2
    Sythe Gold:
    0

    mu-b War is a Drug
    Banned

    grab processor name

    Code:
    char format[] = "%s %s\n";
    char msg[] = "Your Processer is:";
    char pr[13];
    
    int main()
    {
       
    
          __asm
       {
       
          xor eax,eax      
          cpuid
    
          mov dword ptr [pr],ebx
          mov dword ptr [pr+4],edx
          mov dword ptr [pr+8],ecx
           mov dword ptr [pr+12],0
    
         mov  eax, offset pr
         push eax
         mov  eax, offset msg
         push eax
         mov  eax, offset format
         push eax
         call printf
    
    
         pop  ebx
         pop  ebx
         pop  ebx
      }
    
      return 0;
    } 
    tells u the name of you're processor.
     
  3. Unread #2 - Aug 20, 2009 at 2:08 AM
  4. super_
    Joined:
    Dec 20, 2008
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0

    super_ Member

    grab processor name

    Best part: That code will only work in C, where empty arg list means undefined arg list. Now tell me, do you even know what that code does? Why xor eax,eax. That much of a speed whore that you won't sub eax,eax, or mov eax,0?
     
< HTTP Wrapper for VB.Net? | aim usr status >

Users viewing this thread
1 guest


 
 
Adblock breaks this site