<?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>#pragma iv</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/32143/pragma-iv</link><description> 
Hello: 

 
I have a project where I use #pragma iv(0x600), with Silabs
processor 8051F385. 
This processor indicates that interrupt 8 at 0x43 is &amp;quot;special&amp;quot; and
when generating HEX file, the address is still at 43h. Why the
compiler #pragma won&amp;#39;t translate</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/137068?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2013 11:42:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:60fbe6d1-c76e-4d44-82ba-835e11879307</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;The thing is that the compiler just doesn&amp;#39;t modify the vector
to point to this ISR !&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
How could it? Nobody passed &lt;b&gt;your&lt;/b&gt; choice of compiler flags
to &lt;b&gt;their&lt;/b&gt; run of the compiler. And unless you get into contact
with them and convince them to build your a specialized copy (or give
you source code), nobody ever will.&lt;/p&gt;

&lt;p&gt;
There&amp;#39;s actually no way you can use that option on pre-compiled
third-party code. You&amp;#39;ll have to make your own vector table entry and
then call their interrupt handler. There will be two tricky parts
about this:&lt;br /&gt;
1) finding that actual interrupt handler function (the C function
their vector table entry points at)&lt;br /&gt;
2) avoiding the disruption their interrupt vector table entry would
generate in your program, if it were included.&lt;/p&gt;

&lt;p&gt;
On a related note, I really don&amp;#39;t believe that
&lt;b&gt;I&lt;/b&gt;nt&lt;b&gt;V&lt;/b&gt;ector(offset) is a C51 option which one should ever
set by #pragma. This is an option that has to be applied uniformly
across the entire program, so it really should be set at the top-most
level of the build system. Sticking it as a #pragma into some header
risks that some modules will not get the news, and thus become
incompatible with the rest. Hiding that #pragma in individual .c
files would practically guarantee that kind of failure.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/137069?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2013 05:52:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b19ed77e-00ec-47b5-9345-45bae0e8ac0b</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
I just recall that there is something fuzzy about ISRs and
libraries. Since I am not much of a library user, (it is a ***
trying to debug something you do not have the source for) I can only
say &amp;quot;I tend to recall that&amp;quot; ISRs inside a library are called by
nobody and thus ignored. You need to contact wherever you got those
library routines.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/128389?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2013 13:23:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8ce97862-fea6-428a-b1c8-4ac7b9a5facd</guid><dc:creator>Juan Velasquez</dc:creator><description>&lt;p&gt;&lt;p&gt;
Lol...&lt;br /&gt;
Well, I am missing something. There&amp;#39;s a precompiled library that
utilizes this interrupt and it is not in the source code. The thing
is that the compiler just doesn&amp;#39;t modify the vector to point to this
ISR !&lt;br /&gt;
Once I add the interrupt function it does it. How can I cheat the
compiler to do this ?&lt;br /&gt;
Thanks&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/120198?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2013 11:14:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:46623dcb-9bbb-4ed7-83cd-4005a1618d2d</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;How&amp;#39;s the compiler knowing that there&amp;#39;s an interrupt there
?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
It does not, you have to tell it. If the interrupt s enabled and
you do not have an ISR your code will blow&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;so why the #pragma iv(0x600) does not affect this ?&lt;/i&gt;&lt;br /&gt;
see above I did describe it. &lt;b&gt;The interrupt vector is HARDWARE
DEFINED and will ALWAYS be at 43h. The compiler will, when told
insert a ljmp to 643h at 43h&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
The next version of Keil will magically change the connections
inside the chip so the hardware will work difrerently :)&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/107416?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2013 10:26:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:16bd2733-88d1-4e03-8f0b-a45fedd23570</guid><dc:creator>Juan Velasquez</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Erik:&lt;br /&gt;
Thanks for the response&lt;br /&gt;
I have another question, perhaps you can enlighten me:&lt;/p&gt;

&lt;p&gt;
I am using USBX_f38x.lib, which uses interrupt 8 &amp;quot;on its own&amp;quot;... I
mean that my source doesn&amp;#39;t define this interrupt, hence the compiler
is not modifying the 43h to 643h. How&amp;#39;s the compiler knowing that
there&amp;#39;s an interrupt there ? If so why the #pragma iv(0x600) does not
affect this ?&lt;br /&gt;
Thanks&lt;br /&gt;
Juan&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/93092?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2013 09:41:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7a891563-c8f5-4628-8026-0d663df18aa2</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;This processor indicates that interrupt 8 at 0x43 is &amp;quot;special&amp;quot;
and when generating HEX file, the address is still at 43h. Why the
compiler #pragma won&amp;#39;t translate it to 643h?&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
the only thing &amp;#39;special&amp;#39; is the Pending Flag.&lt;/p&gt;

&lt;p&gt;
The interrupt vector is hardware defined and will ALWAYS be at
43h. The compiler wil, when told insert a ljmp to 643h at 43h&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: #pragma iv</title><link>https://community.arm.com/thread/62408?ContentTypeID=1</link><pubDate>Tue, 19 Nov 2013 07:58:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5fdc889f-a457-488b-88f4-da2dcf35c129</guid><dc:creator>Juan Velasquez</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry guys, I was misled by the that there was no interrupt
defined inside the source code, however one of the libraries actually
uses it. Once the body is defined inside the source, it will generate
it.&lt;br /&gt;
Thanks anyways!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>