<?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>Change register before stack operation in Interrupt</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/23916/change-register-before-stack-operation-in-interrupt</link><description> 
At the start of the interrupt operation, I would like to change
some register value before push the registers to the stack. 

 
For example, 

 
void test(void) interrupt 7 
{ CLKSEL = 0x02; ... 
} 

 
is compiled to the file as follows with the current</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Change register before stack operation in Interrupt</title><link>https://community.arm.com/thread/113999?ContentTypeID=1</link><pubDate>Wed, 11 Jun 2008 14:16:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:44fac101-3370-4753-959e-cdc78762027d</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;this will tell the compiler to use resister bank 1 for this
interrupt. Then it will not push anything on the stack&lt;/i&gt;&lt;br /&gt;
not correct&lt;/p&gt;

&lt;p&gt;
correct:&lt;br /&gt;
then it will not push R0-R7 on the stack, but will push the PSW and,
if needed acc, b, dph and dpl&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: Change register before stack operation in Interrupt</title><link>https://community.arm.com/thread/100742?ContentTypeID=1</link><pubDate>Wed, 11 Jun 2008 12:53:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dca66b29-23c6-4b28-8629-390541184935</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
try&lt;/p&gt;

&lt;pre&gt;
void test(void) interrupt 7 using 1
{
   CLKSEL = 0x02; ...
}
&lt;/pre&gt;

&lt;p&gt;
this will tell the compiler to use resister bank 1 for this
interrupt. Then it will not push anything on the stack.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change register before stack operation in Interrupt</title><link>https://community.arm.com/thread/100741?ContentTypeID=1</link><pubDate>Wed, 11 Jun 2008 04:20:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ada06dea-07b1-4d88-9f16-9e68a08d944b</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;I would like to clock up before the interrupt
procedure.&lt;/i&gt;&lt;br /&gt;
are you saying that you change the colok frequency?? battry
operated??&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Could you show me a sample in assembler?&lt;/i&gt;&lt;br /&gt;
if you are too weak in assembler to do this yourself, go fo a
register stack switch (&amp;#39;using&amp;#39;) instead. you would need to code the
entire ISR in assembler and how can i show you &amp;#39;an example&amp;#39; of a
complete ISR you have not told me what does&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;I wonder that the asm/endasm section is set before pushing
registers to the stack&lt;/i&gt;&lt;br /&gt;
no, no, no, the keil implementation of &amp;quot;asm/endasm&amp;quot; is horrible, it
destoys your debugging.&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: Change register before stack operation in Interrupt</title><link>https://community.arm.com/thread/76373?ContentTypeID=1</link><pubDate>Tue, 10 Jun 2008 20:53:19 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d3e4b197-13db-466e-9e93-10b014301639</guid><dc:creator>Hiroto Ishibashi</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you for your advice. I would like to clock up before the
interrupt procedure.&lt;/p&gt;

&lt;p&gt;
Could you show me a sample in assembler? I wonder that the
asm/endasm section is set before pushing registers to the stack.&lt;/p&gt;

&lt;p&gt;
Thanks,&lt;br /&gt;
Hiroto&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change register before stack operation in Interrupt</title><link>https://community.arm.com/thread/51833?ContentTypeID=1</link><pubDate>Tue, 10 Jun 2008 18:48:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d3b6f6d2-e514-47f4-93f5-112eeec9877c</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Can I get the file as follows?&lt;/i&gt;&lt;br /&gt;
sure, write it in assembler.&lt;/p&gt;

&lt;p&gt;
also, in C if you use a different register bank, R0-R7 are not
pushed, just the bank is changed.&lt;/p&gt;

&lt;p&gt;
by the way WHY?&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>