<?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>What is the function of the &amp;quot;paragraph number&amp;quot; in a HEX file?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/16789/what-is-the-function-of-the-paragraph-number-in-a-hex-file</link><description> Hlello,everyone, 
 
Now I use the C167 system, and when I have compiled a project with uVision, I will find the first line in the HEX file like this:&amp;quot;:020000020000FC&amp;quot;. 
 
In the &amp;quot;Intel HEX File Format&amp;quot; section of &amp;quot;C16x/ST10 Assembler and Utilities User</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: What is the function of the "paragraph number" in a HEX file?</title><link>https://community.arm.com/thread/95833?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2003 05:32:40 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7829b19e-a485-4ea5-9d4e-70cb9a02eb07</guid><dc:creator>Stefan  Fricke</dc:creator><description>&lt;p&gt;Usually you can select the output format.&lt;br /&gt;
This is than &lt;b&gt;HEX-386(H167&lt;/b&gt;) under &amp;#39;Options for Target&amp;quot; --&amp;gt; &amp;quot;Output&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
So you get a &lt;b&gt;Extended Linear-Address Record.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There is no reason to think about the paragraphs.&lt;br /&gt;
&lt;br /&gt;
µVision2 will handle it for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the function of the "paragraph number" in a HEX file?</title><link>https://community.arm.com/thread/71940?ContentTypeID=1</link><pubDate>Tue, 30 Sep 2003 23:55:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:48404cbe-f546-4546-b839-918e702e927e</guid><dc:creator>Jichao Yu</dc:creator><description>&lt;p&gt;Thanks.&lt;br /&gt;
&lt;br /&gt;
Then it is not use for me in the C167 system?I want to make sure.&lt;br /&gt;
&lt;br /&gt;
If some use, then how can I change the paragraph number?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the function of the "paragraph number" in a HEX file?</title><link>https://community.arm.com/thread/41012?ContentTypeID=1</link><pubDate>Tue, 30 Sep 2003 06:59:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:717f7fca-b8ae-414b-8512-8f9028b18b69</guid><dc:creator>Stefan  Fricke</dc:creator><description>&lt;p&gt;This historically comes from INTEL and is not relevant for you, since the segments in&lt;br /&gt;
the C16x and XC16x are fixed.&lt;br /&gt;
&lt;br /&gt;
At a PC you find following register&lt;br /&gt;
&lt;br /&gt;
Codesegment CS          IP Instructionpointer&lt;br /&gt;
Datasegment DS          SI/DI/BX	                (Index register )&lt;br /&gt;
Extrasegment ES         SI/DI/BX&lt;br /&gt;
Stack-Segment SS        SP/BP&lt;br /&gt;
-------------------------------------&lt;br /&gt;
IP	= 	Instruction Pointer&lt;br /&gt;
SI	=	Source Index&lt;br /&gt;
DI	=	Destination Index&lt;br /&gt;
SP	=	Stackpointer&lt;br /&gt;
BP	=	Base Pointer&lt;br /&gt;
-------------------------------------&lt;br /&gt;
&lt;br /&gt;
Segmentregisters are only 16 Bit wide, what&lt;br /&gt;
is not enough to address e.g 1 MB memory or&lt;br /&gt;
more.&lt;br /&gt;
That&amp;#39;s why it the tricky offset addressing,&lt;br /&gt;
was found.&lt;br /&gt;
&lt;br /&gt;
We divide the memory by 16. This results in 65536 points in memory which have a distance of 16 byte to each other.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
This points are called PARAGRAPH&amp;#39;s.&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
if we now need a 20-bit address to address such a paragraph, we must multiply the contence of the related segment register&lt;br /&gt;
by 16.&lt;br /&gt;
With Hexa-numbers this is easy done.&lt;br /&gt;
Simply concatenate a &amp;#39;0&amp;#39;.&lt;br /&gt;
This 20-bit addresse is now the start point of the segment.&lt;br /&gt;
&lt;br /&gt;
To move in such a segment you need a second register called offset register.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
So we have a notation as&lt;br /&gt;
&lt;br /&gt;
Segment : Offset&lt;br /&gt;
e.g.&lt;br /&gt;
C000:0400  PC-side&lt;br /&gt;
e.g.&lt;br /&gt;
C014BEH&lt;br /&gt;
CO = segment 14BE = offset&lt;br /&gt;
&lt;br /&gt;
Offsetregisters are 16-bit wide too and so&lt;br /&gt;
they can only address 64 KByte.&lt;br /&gt;
This is the reason, why a segment can be max. 64kByte.&lt;br /&gt;
&lt;br /&gt;
But as you see, here we use data page pointer&lt;br /&gt;
as offset with 16KByte each.&lt;br /&gt;
So the calculation of addresses is slightly different between and micro.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>