<?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>lookup table in code segment</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33174/lookup-table-in-code-segment</link><description> Hi there, 
I had a font bitmap table which is 1088 bytes. The Ram in chip is not big enough. So I am thinking to put it in code segment. My questions are 
How do I do it in C and 
If the lut were in code segment, how can i access it? 
I am using 89c51rd</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: lookup table in code segment</title><link>https://community.arm.com/thread/54878?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2002 13:43:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6cb2814b-b35f-4f04-81df-943b68d92906</guid><dc:creator>Abel Pan</dc:creator><description>&lt;p&gt;Thank you Drew.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lookup table in code segment</title><link>https://community.arm.com/thread/54877?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2002 13:36:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:312ac59a-8349-40a1-a551-5543028e6858</guid><dc:creator>Abel Pan</dc:creator><description>&lt;p&gt;Thank you Jon.&lt;br /&gt;
That works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lookup table in code segment</title><link>https://community.arm.com/thread/39517?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2002 13:27:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cfcd160d-5ab4-4c0e-a76e-8d06ea77ac21</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;Declare your font bitmap as living in the &amp;quot;code&amp;quot; memory space, e.g.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
const U8 code bitmap[] = { 1, 2, 3, 4 };
&lt;/pre&gt;
&lt;br /&gt;
The compiler will take care of accessing the variable via the MOVC instruction to access the code memory space through the DPTR instead of MOVX for external data.&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: lookup table in code segment</title><link>https://community.arm.com/thread/39516?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2002 13:26:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dd02ee6d-895b-4587-af3d-4c5dafb7d5a5</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;To declare a table in code space...&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
unsigned char code table [] = 
  { 1, 2, 3, 4, 5, };
&lt;/pre&gt;
&lt;br /&gt;
You access it just like any other variable.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>