<?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>Inline assembly : stack (LPC2478)</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/25006/inline-assembly-stack-lpc2478</link><description> 
Hello, 

 
I&amp;#39;m trying to solve a problem. 
I&amp;#39;m using LPC2478 

 
I have the register FIO0MASK that is used in normal routines and
interrupt routines. 
If a interrupt that changes FIO0MASK value is executed after FIO0MASK
set when the interrupt returns</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Inline assembly : stack (LPC2478)</title><link>https://community.arm.com/thread/55809?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2009 06:31:14 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3330f55b-263d-460f-8074-2fb9598ab792</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Unless you have nested interrupts, it will also work to save the
mask to a global variable and have the ISR restore the mask before
returning.&lt;/p&gt;

&lt;p&gt;
If you design your hardware so that the ISR only needs to access a
8-bit or 16-bit subset, then you may get away with saving a smaller
part of the mask. Or you may even manage to have your hw design fully
isolate bits used by the ISR and the main application, so that the
main application performs 8-bit or 16-bit operations to parts of the
port and the ISR performs 8-bit or 16-bit operations to another part
of the port.&lt;/p&gt;

&lt;p&gt;
Anyway - don&amp;#39;t do inline assembly. If you write in C or C++, then
just use a local variable on the stack for storing the mask state.
The alternative is to write the full ISR in assembler in a separate
file.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>