<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visual C++ Tips &#187; processor name</title>
	<atom:link href="http://weseetips.com/tag/processor-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://weseetips.com</link>
	<description>Gold mine of Visual C++ tricks!</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:09:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>How to get the CPU Name String?</title>
		<link>http://weseetips.com/2009/06/21/how-to-get-the-cpu-name-string/</link>
		<comments>http://weseetips.com/2009/06/21/how-to-get-the-cpu-name-string/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 18:29:49 +0000</pubDate>
		<dc:creator>Jijo Raj</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Visual C++]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[C++ cpu name]]></category>
		<category><![CDATA[c++ get cpu name]]></category>
		<category><![CDATA[C++ get processor name]]></category>
		<category><![CDATA[CPU brand string]]></category>
		<category><![CDATA[cpu name]]></category>
		<category><![CDATA[Cpu name string]]></category>
		<category><![CDATA[get Cpu name]]></category>
		<category><![CDATA[get processor name]]></category>
		<category><![CDATA[intrin.h]]></category>
		<category><![CDATA[processor name]]></category>
		<category><![CDATA[VC++]]></category>
		<category><![CDATA[VC++ cpu name]]></category>
		<category><![CDATA[VC++ get cpu name]]></category>
		<category><![CDATA[VC++ get processor name]]></category>
		<category><![CDATA[__cpuid]]></category>

		<guid isPermaLink="false">http://weseetips.com/?p=1163</guid>
		<description><![CDATA[While taking the System properties, you have noticed the processor name string. For instance, in my laptop it is &#8211; &#8220;Intel(R) Core(TM)2 Duo CPU T5250 @ 1.50GHz&#8220;. Ever though about how to get this processor name string? Image Courtesy &#8211; Wallpaper Mania. You can use the function &#8211; __cpuid(), which generates the instruction &#8211; cpuid. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-11" title="Icon Description" src="http://weseetips.wordpress.com/files/2008/03/icon_description.jpg?w=166" alt="" width="166" height="32" /></p>
<p>While taking the System properties, you have noticed the processor name string. For instance, in my laptop it is &#8211; &#8220;<span style="color: #0000ff;">Intel(R) Core(TM)2 Duo CPU     T5250  @ 1.50GHz</span>&#8220;. Ever though about <span style="color: #0000ff;">how to get this processor name string</span>?</p>
<p><img class="alignnone size-full wp-image-1166" title="cpuid" src="http://weseetips.wordpress.com/files/2009/06/cpuid.jpg" alt="cpuid" width="400" height="300" /></p>
<p>Image Courtesy &#8211; <a href="http://piczzmania.blogspot.com/">Wallpaper Mania</a>.</p>
<p><img class="alignnone size-medium wp-image-12" title="Icon How Can I Do It?" src="http://weseetips.wordpress.com/files/2008/03/icon_howcanidoit.jpg?w=220" alt="" width="220" height="32" /></p>
<p>You can use the function &#8211; <span style="color: #0000ff;"><strong>__cpuid()</strong></span>, which generates the instruction &#8211; cpuid. Have a look at the code snippet. Code taken and modified from MSDN.</p>
<pre>#include &lt;iostream&gt;
#include &lt;intrin.h&gt;

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    // Get extended ids.
    int CPUInfo[4] = {-1};
    __cpuid(CPUInfo, 0x80000000);
    unsigned int nExIds = CPUInfo[0];

    // Get the information associated with each extended ID.
    char CPUBrandString[0x40] = { 0 };
    for( unsigned int i=0x80000000; i&lt;=nExIds; ++i)
    {
        __cpuid(CPUInfo, i);

        // Interpret CPU brand string and cache information.
        if  (i == 0x80000002)
        {
            memcpy( CPUBrandString,
            CPUInfo,
            sizeof(CPUInfo));
        }
        else if( i == 0x80000003 )
        {
            memcpy( CPUBrandString + 16,
            CPUInfo,
            sizeof(CPUInfo));
        }
        else if( i == 0x80000004 )
        {
            memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo));
        }
}

    cout &lt;&lt; "Cpu String: " &lt;&lt; CPUBrandString;
}</pre>
<p><img class="alignnone size-medium wp-image-18" title="Icon Note" src="http://weseetips.wordpress.com/files/2008/03/icon_note.jpg?w=94" alt="" width="94" height="32" /><br />
You can get a lot of information about cpu by using __cpuid. Have a look at the <a href="http://msdn.microsoft.com/en-us/library/hskdteyh(VS.80).aspx">MSDN Documentation</a>.</p>
<p><img class="alignnone size-medium wp-image-53" title="intermediateseries" src="http://weseetips.wordpress.com/files/2008/03/intermediateseries.jpg?w=248" alt="" width="248" height="32" /><br />
Targeted Audiance &#8211; Intermeidate.</p>
]]></content:encoded>
			<wfw:commentRss>http://weseetips.com/2009/06/21/how-to-get-the-cpu-name-string/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

