<?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>struct&amp;#39;s in C51</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25183/struct-s-in-c51</link><description> 
Hello 

 
I got the DTMF tone generator example from 
 http://www.keil.com/download/docs/234.asp 
and it works great, however when I integrate the routines into
another program I get a compiliation error : 

 
*** ERROR L107: ADDRESS SPACE OVERFLOW</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: struct's in C51</title><link>https://community.arm.com/thread/55969?ContentTypeID=1</link><pubDate>Fri, 01 May 2009 09:45:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cf808571-286b-4dce-9b65-817e22fe007c</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
You are asking how you wrote you code?&lt;br /&gt;
Variables are in RAM that is why they are variable.&lt;br /&gt;
If it is fixed data (struct or not) you can instruct the compiler to
put them in ROM.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: struct's in C51</title><link>https://community.arm.com/thread/103075?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2009 15:06:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8fa8e667-45b6-424d-abc2-0abfaf3fcc2b</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Strictly, it has a &lt;b&gt;&lt;i&gt;modified&lt;/i&gt; Harvard
architecture:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot; ... a variation of the Harvard computer architecture that
allows the contents of the instruction memory to be accessed as if it
were data. Most modern computers that are documented as Harvard
Architecture are, in fact, Modified Harvard Architecture.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://en.wikipedia.org/wiki/Modified_Harvard_architecture"&gt;en.wikipedia.org/.../Modified_Harvard_architecture&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Note also that the 8051 doesn&amp;#39;t just have separate code and data
spaces - it also has several distinct data spaces.&lt;br /&gt;
Again, see: &lt;a href="http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
For the basics of the 8051 architecture,&lt;br /&gt;
see: &lt;a href="http://www.8052.com/faqs/120112"&gt;www.8052.com/.../120112&lt;/a&gt;&lt;br /&gt;

and: &lt;a href="http://www.8052.com/tut8051"&gt;http://www.8052.com/tut8051&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: struct's in C51</title><link>https://community.arm.com/thread/89715?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2009 14:18:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b4123554-0e9e-4e4b-92a2-adadd33b6966</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;I just don&amp;#39;t understand why it would run out of space in the
MAIN segment, there isn&amp;#39;t a lot of code in there&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
the &amp;#39;51 is a HARVARD architecture&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: struct's in C51</title><link>https://community.arm.com/thread/55967?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2009 10:44:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6ae17aec-17a3-4ea0-a4de-78d0022cd30f</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;I&amp;#39;m trying to figure out what would be using &lt;b&gt;so much&lt;/b&gt;
(sic?) RAM.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You do realise that the DATA space in the 8051 architecture is
only 128 bytes - so it really isn&amp;#39;t much at all!&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;I see the code is using a lot of struct&amp;#39;s, are those stored in
RAM?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Whether they are structs or not has no effect on where they are
stored.&lt;/p&gt;

&lt;p&gt;
You can specify where individual items are stored: &lt;a href="http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
You can also adjust the default: &lt;a href="http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Note that accessing XDATA is slower, abd takes more code...&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;I&amp;#39;ve looked at the M51 file I just don&amp;#39;t understand why it
would run out of space in the MAIN segment, there isn&amp;#39;t a lot of code
in there&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
The size of the code has no direct relation to the size of the
data!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: struct's in C51</title><link>https://community.arm.com/thread/55966?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2009 07:01:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a128232c-fb29-4462-b23b-d5e27f46f35f</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;I&amp;#39;m trying to figure out what would be using so much RAM. I see
the code is using a lot of struct&amp;#39;s, are those stored in RAM?&lt;/i&gt;&lt;br /&gt;
yes, unless they are preceeded by e.g &amp;#39;code&amp;#39;&lt;/p&gt;

&lt;p&gt;
the manual, sorry, let you know which keywords to preceede
declarations and definitions with.&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>