<?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>Explanation of code</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38301/explanation-of-code</link><description> 
Hi can someone please help with the explanation of this code
below, more importantly how does the uC &amp;#39;see&amp;#39; the Sqrs: line at the
end of the code 

 
I am interested in something similar in a project i am currently
doing whereby the input data of a PORT</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/103022?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 02:42:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:059ae2bb-0f3e-414b-8ae5-d3042f289180</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
My fingers (or whatever part of the anatomy that is involved)
seems to play tricks on me.&lt;/p&gt;

&lt;p&gt;
sheat -&amp;gt; sheet - i wasn&amp;#39;t talking about the fish :)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/114816?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 01:37:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7ad77324-2491-4abf-b456-36428b12c75d</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;i&amp;#39;ve seemed to grasp is now after a good bit of simulation and
debugging&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You really need to study those documents to lay a proper
&lt;i&gt;&lt;b&gt;Foundation&lt;/b&gt;&lt;/i&gt; - otherwise (to use a truly Biblical
metaphor) you are building on sand...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/101771?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 01:34:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fa638bb9-0a6e-4bea-8f13-b3991a7fc141</guid><dc:creator>Jack L</dc:creator><description>&lt;p&gt;&lt;p&gt;
thanks everyone&lt;/p&gt;

&lt;p&gt;
i&amp;#39;ve seemed to grasp is now after a good bit of simulation and
debugging:)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/89653?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 00:47:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9d2e6a5f-3d80-4450-bd40-10c515105bef</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Actually, the processor never &amp;quot;sees&amp;quot; any source code - all it ever
sees is the content of memory that results from that source code.&lt;/p&gt;

&lt;p&gt;
The so-called &amp;quot;bible&amp;quot; tells you how the processor will react to
the contents of memory;&lt;/p&gt;

&lt;p&gt;
The &lt;b&gt;Manuals&lt;/b&gt; for your assembler tell you how it will
interpret the source code:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/a51/"&gt;http://www.keil.com/support/man/docs/a51/&lt;/a&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/89656?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 00:45:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9aea7899-db4e-4580-9197-a4febbc944ba</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
If the processor is instructed to jump to the start of the sqrs
table, it will see the table as a number of instructions - see the
instruction sheat to find out what instructions - that will most
probably make the processor do very unexpected things.&lt;/p&gt;

&lt;p&gt;
But in this case, the array of bytes are never used as
instructions. They are instead used with the&lt;br /&gt;
movc a, @a + PC&lt;br /&gt;
instruction, that will pick up the [PC+a] element from the array.
Note that there is a single ret instruction between the movc
instruction and the start of the array. That is the reason why the
program needs to add an inc a before making the lookup. The lookup
will fail - or at least pick up values from an incorrect location -
if you happen to add other instructions between movc and ret, or
between ret and the sqrs table.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/55770?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2009 00:24:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ab064b76-9b7e-4e11-b256-c8d966442526</guid><dc:creator>Christoph Franck</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Hi can someone please help with the explanation of this code
below, more importantly how does the uC &amp;#39;see&amp;#39; the Sqrs: line at the
end of the code&lt;/i&gt;&amp;lt;p&amp;gt;&lt;/p&gt;

&lt;p&gt;
Why shouldn&amp;#39;t it &amp;quot;see&amp;quot; it? The processor can &amp;quot;see&amp;quot; anything that
is in accessible memory areas.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Explanation of code</title><link>https://community.arm.com/thread/89655?ContentTypeID=1</link><pubDate>Tue, 31 Mar 2009 15:50:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4d9df3c1-26a7-43fd-ba87-f1d171e593bf</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
here are the links to &amp;quot;the bible&amp;quot;&lt;br /&gt;
Chapter 1 - 80C51 Family Architecture:&lt;br /&gt;
Chapter 1 - 80C51 Family Architecture:&lt;br /&gt;
&lt;a href="http://www.nxp.com/acrobat_download/various/80C51_FAM_ARCH_1.pdf"&gt;www.nxp.com/.../80C51_FAM_ARCH_1.pdf&lt;/a&gt;&lt;br /&gt;

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

&lt;a href="http://www.nxp.com/acrobat_download/various/80C51_FAM_PROG_GUIDE_1.pdf"&gt;www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf&lt;/a&gt;&lt;br /&gt;

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

&lt;a href="http://www.nxp.com/acrobat_download/various/80C51_FAM_HARDWARE_1.pdf"&gt;www.nxp.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: Explanation of code</title><link>https://community.arm.com/thread/55776?ContentTypeID=1</link><pubDate>Tue, 31 Mar 2009 15:46:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7f0ba9d7-fc0e-4f69-abef-402e1fd72e33</guid><dc:creator>doubt that my ISP Al Bradford</dc:creator><description>&lt;p&gt;&lt;p&gt;
Jack;&lt;br /&gt;
You need to do a topic search on the forum site for the C51 &amp;quot;Bible&amp;quot;
links.&lt;br /&gt;
They fully describe the operation of the 8051 type devices. The PC is
the Program Counter so you are doing indirect addressing PC relative.
There is more to the code but you need to review the &amp;quot;Bible&amp;quot;.&lt;br /&gt;
Bradford&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>