<?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>DATA segment issue - solution required</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/20620/data-segment-issue---solution-required</link><description> 
Hi All, 

 
I am using keil with the following settings 

 
Target Device : Atmel 89C52 
memory model : small - variables in data 
code rom size : large 64k program 
(It has 256 bytes on chip ram ) 

 
This is my code, 

 
#include &amp;lt;reg52.h&amp;gt; 
unsigned</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: DATA segment issue - solution required</title><link>https://community.arm.com/thread/87879?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2006 10:07:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:db9d9934-87eb-42b8-b990-03dfdac309ba</guid><dc:creator>Christoph Franck</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Thanks Dan Henry ..Its working :-)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Great. Do you also understand &lt;b&gt;why&lt;/b&gt; this solves your problem
? You will need to know this or you will run into the next
memory-related problems in about five minutes.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;It is 8052 and then why it is neccessary to specify it has 256
bytes on chip ram. ?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Because &lt;b&gt;on-chip ram&lt;/b&gt; is not the same as &lt;b&gt;data&lt;/b&gt; memory.
Even &lt;b&gt;internal&lt;/b&gt; RAM is not the same as &lt;b&gt;data&lt;/b&gt; memory.&lt;/p&gt;

&lt;p&gt;
The term &amp;quot;&lt;b&gt;data&lt;/b&gt; memory&amp;quot; refers explicitly to the first 128
bytes of internal RAM. Follow the links to the &amp;#39;51 &amp;#39;bible&amp;#39; posted
above.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DATA segment issue - solution required</title><link>https://community.arm.com/thread/46661?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2006 09:53:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e33fe52e-5387-4cd9-917f-6c9a3896e953</guid><dc:creator>Karthik Raja</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks Dan Henry ..Its working :-)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DATA segment issue - solution required</title><link>https://community.arm.com/thread/46660?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2006 09:43:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d6f80995-f40f-46ec-995e-807b6cf18722</guid><dc:creator>Karthik Raja</dc:creator><description>&lt;p&gt;&lt;p&gt;
It is 8052 and then why it is neccessary to specify it has 256
bytes on chip ram. ?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DATA segment issue - solution required</title><link>https://community.arm.com/thread/46658?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2006 09:22:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:12a5ae9f-323a-4289-90d0-4abf653a96e2</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
The DATA address space is limited to 128 bytes - that is an
architectural constraint; there is nothing that you can do about
it!&lt;br /&gt;
So, obviously, you cannot possibly fit a 180-byte array into DATA
space!&lt;/p&gt;

&lt;p&gt;
You need to go back to the so-called &amp;quot;bible&amp;quot; for the 8051:&lt;/p&gt;

&lt;p&gt;
Chapter 1 - 80C51 Family Architecture:&lt;br /&gt;

&lt;a href="http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf"&gt;www.semiconductors.philips.com/.../80C51_FAM_ARCH_1.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Chapter 2 - 80C51 Family Programmer&amp;#39;s Guide and Instruction
Set:&lt;br /&gt;

&lt;a href="http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf"&gt;www.semiconductors.philips.com/.../80C51_FAM_PROG_GUIDE_1.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Chapter 3 - 80C51 Family Hardware Description:&lt;br /&gt;

&lt;a href="http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf"&gt;www.semiconductors.philips.com/.../80C51_FAM_HARDWARE_1.pdf&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DATA segment issue - solution required</title><link>https://community.arm.com/thread/46657?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2006 09:19:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b03cdad3-10ff-4b7a-ab5a-7aa896a9dd84</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
Does this work?&lt;/p&gt;

&lt;p&gt;
unsigned char &lt;b&gt;idata&lt;/b&gt; Array[180];&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>