home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,959 of 4,675   
   Melzzzzz to Bonita Montero   
   Re: RTM-question   
   15 Oct 19 05:07:03   
   
   From: Melzzzzz@nospicedham.zzzzz.com   
      
   On 2019-09-27, Bonita Montero  wrote:   
   >   
   > bool hasTSX()   
   > {   
   > #if defined(_MSC_VER)   
   >      int regs[4];   
   >      __cpuidex( regs, 7, 0 );   
   >      return regs[1] & (1 << 11);   
   > #else   
   >      return true;   
   > #endif   
   > }   
   >   
   void cpuid(int CPUInfo[4],int InfoType){   
       __asm__ __volatile__ (   
           "cpuid":   
           "=a" (CPUInfo[0]),   
           "=b" (CPUInfo[1]),   
           "=c" (CPUInfo[2]),   
           "=d" (CPUInfo[3]) :   
           "a" (InfoType), "c" (0)   
       );   
   }   
   bool rtmSupported()   
   {   
       int info[4];   
       cpuid(info, 0);   
       int nIds = info[0];   
       if (nIds >= 0x00000001){   
           cpuid(info,0x00000007);   
      
           return (info[2] & ((int)1 <<  11)) != 0;   
       }   
       return false;   
   }   
   Someone should correct me if I am wrong...   
      
   --   
   press any key to continue or any other to quit...   
   U niÄ   
   emu ja ne uživam kao u svom statusu INVALIDA -- Zli Zec   
   Na divljem zapadu i nije bilo tako puno nasilja, upravo zato jer su svi   
   bili naoruzani. -- Mladen Gogala   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca