<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/22121/generic-pointer-memory-type-identification</link><description> 
Hi, 

 
how can I identify a memory type of any generic pointer in C51
code? 

 
Thanks. 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/thread/113209?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2007 10:15:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:46285ead-bb64-4e2b-a37a-e1ecca5db451</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;d also create an enum (or at least series of #defines) for the
constant values of the type tags.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/thread/99629?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2007 07:58:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0400b7b6-7440-449d-a397-2e35dffd1f54</guid><dc:creator>ashley madison</dc:creator><description>&lt;p&gt;&lt;p&gt;
Oh, and your function should really be:&lt;/p&gt;

&lt;pre&gt;
void mem_type_detector (&lt;b&gt;void&lt;/b&gt; *generic_ptr)
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/thread/99627?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2007 07:38:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:843b1a97-6064-4622-a289-1bea9011596f</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;pre&gt;
switch (*(unsigned char*)&amp;amp;generic_ptr)
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/thread/75475?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2007 07:03:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c2040a03-8ee6-410b-85df-de6e8b4299a7</guid><dc:creator>O. Ravdouha</dc:creator><description>&lt;p&gt;&lt;p&gt;
Ok, thank you, but... what should I write instead of &amp;quot;???&amp;quot; in the
sample below to detect the memory type of the generic pointer
(function parameter)?&lt;/p&gt;

&lt;pre&gt;
void mem_type_detector (char *generic_ptr)
{
   switch (???)
   {
      case 0x00:  // DATA
         //...
         break;

      case 0x01:  // XDATA
         //...
         break;
      //...
   }
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generic Pointer: Memory Type Identification</title><link>https://community.arm.com/thread/48567?ContentTypeID=1</link><pubDate>Wed, 12 Sep 2007 05:28:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d4e6d693-c497-4542-9fce-73012db224a3</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
A generic pointer&amp;#39;s encoding is described in the manual.&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/c51/c51_ap_genericptr.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_ap_genericptr.htm&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>