<?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 add the two numbers in this controller</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/20601/how-to-add-the-two-numbers-in-this-controller</link><description> 
 sir , 

 
 i want to add to data from the external memory. so i need
correct format for this controller 

 

XBYTE[0x1234] = 0x55;
XBYTE[0x1245] = 0x11;

 

 
 how to add this data and save it to another memory 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/123864?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2007 06:06:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a30cf8f9-60c7-4b29-a721-50496e31d605</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have you looked for manuals and sample programs for the processor
of choice?&lt;/p&gt;

&lt;p&gt;
There are huge amounts of information available!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/112925?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2007 04:25:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6080b0fd-6544-410f-a0b9-b9820e786a1b</guid><dc:creator>Ranjith kumar Kandasamy</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&lt;br /&gt;
sir&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;i want some details about Serial COM port. how the data get it
from the Serial port. So what is the procedure for that type of
program&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/112923?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2007 02:32:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0eb170f9-a9d8-492e-b6cf-07914a050fe2</guid><dc:creator>Ranjith kumar Kandasamy</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&lt;br /&gt;
thank you sir&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/99281?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 20:11:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e6599bd5-625d-458e-aeff-7f6b20d07715</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;b&gt;Pointers&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;reg51.h&amp;gt;
#include&amp;lt;intrins.h&amp;gt;


unsigned char xdata *addend;
unsigned char xdata *augend;
unsigned int  xdata sum;
void main()
{
   addend = 0x1234;
   augend = 0x1235;

   sum = *addend + *augend;
}
&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;_at_&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;reg51.h&amp;gt;
#include&amp;lt;intrins.h&amp;gt;


unsigned char xdata addend _at_ 0x1234;
unsigned char xdata augend _at_ 0x1235;
unsigned int  xdata sum;
void main()
{
   sum = addend + augend;
}
&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;XBYTE&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;reg51.h&amp;gt;
#include&amp;lt;intrins.h&amp;gt;


unsigned int  xdata sum;
void main()
{
   sum = XBYTE[0x1234] + XBYTE[0x1235];
}
&lt;/pre&gt;

&lt;p&gt;
The Manual is your Friend&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/99276?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 05:43:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b5249445-a77c-4072-8f5b-e9bd4175a5de</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;addend is store in the particular memory address&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Is this &lt;i&gt;&lt;b&gt;really&lt;/b&gt;&lt;/i&gt; important to your application?&lt;/p&gt;

&lt;p&gt;
Of course, in practice, the data has to be physically stored in
some specific location - but this is almost always entirely
irrelevant to the program!&lt;br /&gt;
Common exceptions would be shared memory, and memory-mapped IO - is
this what you&amp;#39;re doing? If not, why does the address matter to
you?&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&lt;b&gt;If&lt;/b&gt;&lt;/i&gt; the address really does matter to you, I have
already told you the keyword to use, and given you the relevan
reference in the &lt;b&gt;Manual&lt;/b&gt; - but you are going to have to &lt;b&gt;read
it&lt;/b&gt; for yourself!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/99278?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 05:15:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d9a10cb8-8576-4f5e-86ac-14360227843e</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Why not describing the problem you are trying to solve, instead of
telling us details such that you want the data transfered through the
accumulator?&lt;/p&gt;

&lt;p&gt;
If you give the picture, people can help solving the problem.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/75158?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 04:57:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:daf16089-c58c-4793-a372-81276dc97c8c</guid><dc:creator>Ranjith kumar Kandasamy</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&lt;br /&gt;
sorry sir. i had concentrate in some other work. so i had using new
thread list.then coming to my point. i want a data for ex 0x55 is
data. i want to get the data from particular memory location. so i
have using XBYTE. But ur ans coding is the data is transfer through
acc. it is corect. but i want&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;addend is store in the particular memory address &amp;amp;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;augend is store in the another memory address and&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;result sum is stored in some other memory location&lt;br /&gt;&lt;/i&gt;&lt;/p&gt;

&lt;pre&gt;

#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;reg51.h&amp;gt;
#include&amp;lt;intrins.h&amp;gt;


unsigned char xdata addend;
unsigned char xdata augend;
unsigned int  xdata sum;
void main()
{
addend = 0x55;
augend = 0x11;

sum = addend + augend;
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/50805?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 03:40:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:31ffb26e-4988-4156-a039-5f05ef2318de</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Why are you using XBYTE?&lt;br /&gt;
Why don&amp;#39;t you define &lt;b&gt;variables&lt;/b&gt; instead?&lt;br /&gt;
eg,&lt;/p&gt;

&lt;pre&gt;
unsigned char xdata addend;
unsigned char xdata augend;
unsigned int  xdata sum;

addend = 0x55;
augend = 0x11;

sum = addend + augend;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
See: &lt;a href="http://www.keil.com/support/man/docs/c51/c51_le_xdata.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_le_xdata.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
If the absolute location in XDATA matters, use the &lt;b&gt;_at_&lt;/b&gt;
keyword:&lt;br /&gt;
&lt;a href="http://www.keil.com/support/man/docs/c51/c51_le_absvarloc.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_le_absvarloc.htm&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/48204?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 03:06:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:95c5af99-57cb-4c26-bc8b-5e49d9addf2a</guid><dc:creator>Arthur Neagus</dc:creator><description>&lt;p&gt;&lt;p&gt;
a = b + c&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to add the two numbers in this controller</title><link>https://community.arm.com/thread/50807?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2007 02:56:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:55482bc9-7b69-4a02-9083-7b923b7b14e7</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
By writing a program?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>