<?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>how to use global pointer  of C in assembly program</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/17337/how-to-use-global-pointer-of-c-in-assembly-program</link><description> 
/*******************************************/
/*compiler Keil C51 v6.23*/
/*name&amp;amp;#65306;main*/
unsigned char xdata temp;
unsigned char xdata *p;
void func(void);
void main(void)
{	
	unsigned char xdata i;
 while(1)
	{
 p = &amp;amp;temp;	
 *p = 98;	
 func(</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/95040?ContentTypeID=1</link><pubDate>Tue, 07 May 2002 10:31:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d7845b95-0757-463d-90f4-f7e7ab6074be</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;It appears that your C program which you use SRC with is ALWAYS compiled in SMALL memory model.  The following line:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
#pragma src(MYPTR.A51) small
&lt;/pre&gt;
&lt;br /&gt;
tells the compiler to compile in the small memory model.&lt;br /&gt;
&lt;br /&gt;
If you compile other parts of your program in LARGE or COMPACT memory model, the memory areas used for variables won&amp;#39;t match.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/95038?ContentTypeID=1</link><pubDate>Tue, 07 May 2002 09:37:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:83b62e4b-a01f-4413-9ff2-37f2eb73af44</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;the program fly away&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
What does that mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/54375?ContentTypeID=1</link><pubDate>Tue, 07 May 2002 05:20:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cf3766cb-e593-4b86-baf2-54bc379d82f8</guid><dc:creator>New Chinese bird</dc:creator><description>&lt;p&gt;Yes,you are right.Thank you very much!&lt;br /&gt;
But when I chang memory model from SMALL to &lt;br /&gt;
LARGE or COMPACT,the program fly away.Please tell me why and how to adjust it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/54374?ContentTypeID=1</link><pubDate>Tue, 07 May 2002 03:41:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:21e7cbc0-f628-46f5-9f59-edbcc13600f0</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;using a single-character name like &amp;#39;p&amp;#39; is not a good idea for a global variable!&lt;br /&gt;
&lt;br /&gt;
The AX51 &amp;amp; A251 assemblers have a &lt;b&gt;CASE&lt;/b&gt; control to make them case-sensitive; otherwise, they are &lt;b&gt;not.&lt;/b&gt;&lt;br /&gt;
I couldn&amp;#39;t find it actually stated in the manual, but I assume that A51 must be case-&lt;b&gt;in&lt;/b&gt;sensitive?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/38690?ContentTypeID=1</link><pubDate>Mon, 06 May 2002 08:50:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:24fdb083-7371-4982-b31e-841834b23bb7</guid><dc:creator>Jon Young</dc:creator><description>&lt;p&gt;P is sbit in the PSW register.  Use another name other than p.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/38689?ContentTypeID=1</link><pubDate>Mon, 06 May 2002 08:26:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:43f209c7-b5c0-4997-9f05-95baef9e622b</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;What error?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to use global pointer  of C in assembly program</title><link>https://community.arm.com/thread/38688?ContentTypeID=1</link><pubDate>Mon, 06 May 2002 05:41:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:2e821eed-8588-4e4a-9df7-f916438ee9bc</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;Read the section on pointers in the C51 manual - this tells you how pointer values are actually represented in memory.&lt;br /&gt;
Then all you need to do is write your assembler accordingly to use those values!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>