<?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>89c66x 128b DATA and parameters</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/15583/89c66x-128b-data-and-parameters</link><description> Hello everybody, 
 
I&amp;#39;ve a question concerning the internal RAM of derivatives such p89c66x and passing parameters. 
 
As far I&amp;#39;ve understood, the internal RAM has 256 bytes in 89c66x. the 128 first bytes are for stack, registers, bit registers and the</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: 89c66x 128b DATA and parameters</title><link>https://community.arm.com/thread/55077?ContentTypeID=1</link><pubDate>Tue, 04 Mar 2003 16:36:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5e4a581e-6f7f-4c24-a79a-b33606d10487</guid><dc:creator>REY Stephane</dc:creator><description>&lt;p&gt;Well, let&amp;#39;s take an example.&lt;br /&gt;
Here is a function and the associated LST file specially coded for the sample :&lt;br /&gt;
&lt;pre&gt;
#include &amp;quot;reg51f.h&amp;quot;
#include &amp;quot;tdef.h&amp;quot;

void GLCD_DisplayValue (U32 u32Value, U8 u8NumberOfIntegerDigits, U8 u8NumberOfDecimalDigits)
{
	xdata U8 u8Size=0; 			/* Size of the table */
	xdata U8 au8ValueToDisplay[10];		/* String where is converted the value */
	xdata S8 s8CharNumber=0;		/* Character number in the string */

	u32Value=0;
	u8NumberOfIntegerDigits=0;
	u8NumberOfDecimalDigits=0;
	u8Size=0;
	au8ValueToDisplay[0]=0;
	s8CharNumber=0;
}

MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     28    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     12    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       6
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
&lt;/pre&gt;
&lt;br /&gt;
When linking, here is what I can see in the *.M51 file :&lt;br /&gt;
&lt;pre&gt;
            TYPE    BASE      LENGTH    RELOCATION   SEGMENT NAME
            -----------------------------------------------------

            * * * * * * *   D A T A   M E M O R Y   * * * * * * *
...
            DATA    0037H     0006H     UNIT         ?DT?_GLCD_DISPLAYVALUE?GLCD
...
            * * * * * * *  X D A T A   M E M O R Y  * * * * * * *
            XDATA   02B8H     000CH     UNIT         ?XD?GLCD
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
We can see that the 6 bytes of parameters are located in DATA segment.&lt;br /&gt;
Now, when I&amp;#39;ve many functions, the DATA segment has only the allocations of the parameters. To confirm, I&amp;#39;ve moved all the variables to XDATA and now, the remaining bytes allocated in DATA are only parameters.&lt;br /&gt;
&lt;br /&gt;
And I don&amp;#39;t know how to move these parameters somewhere else. Is it really possible ? As I&amp;#39;ve not put any variable in DATA segment, the 128 bytes are used by parameters, registers and stack. And now, there is only 30 bytes remaining !&lt;br /&gt;
&lt;br /&gt;
Is there an issue or I have not understood something ?&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Stephane&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 89c66x 128b DATA and parameters</title><link>https://community.arm.com/thread/39874?ContentTypeID=1</link><pubDate>Tue, 04 Mar 2003 12:55:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d21d6e1b-3ccc-45b8-8366-5483b378efea</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;The passing of parametres is not the problem, it takes place in the registers, the local variables are what is handled as you describe.  The way to make more room: in the least frequented functions make the local parametres IDATA (RAM 128-255) (see the manual) or, if it gets really hairy make them XDATA.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>