<?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>use c variables in inline assembly</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/37186/use-c-variables-in-inline-assembly</link><description> 
main() 
{ char a[10]=&amp;quot;srikanth&amp;quot;; 

 
//----assembly code starts..... 

 
//--------asm ends......... 
// c code 

 
} 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: use c variables in inline assembly</title><link>https://community.arm.com/thread/47891?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2007 18:52:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c74ec91b-a1be-4f26-b035-21a76b98bc0c</guid><dc:creator>Jonny Doin</dc:creator><description>&lt;p&gt;&lt;p&gt;
Inline assembly is a very specific nonstandard feature of a
toolchain. You have specified &lt;b&gt;none&lt;/b&gt; as your MCU.&lt;/p&gt;

&lt;p&gt;
If you are using C51, for example, there is really not such thing
as an &amp;#39;inline assembler&amp;#39; like in other compilers. When you use the
ASM/ENDASM directives the compiler simply includes the text into the
source listing generated with the SRC directive, to be assembled by
the A51 assembler. That is messy and dangerous. I totally agree with
&lt;b&gt;Erik&lt;/b&gt; in that you should always use separate .A51 assembly
routines callable as C functions, in which case you would access the
C data objects using the EXTERN assembler directive, and the access
method will depend on the data object storage class.&lt;/p&gt;

&lt;p&gt;
If you are using ARM RVCT, for example, then you have a true
optimizing inline assembler, and you can access C variables directly
by their names.&lt;/p&gt;

&lt;p&gt;
Whatever the case may be, the integration with C is described in
the toolchain manuals.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: use c variables in inline assembly</title><link>https://community.arm.com/thread/88211?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2007 15:06:34 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8e60a4be-3761-4c3f-ad59-8807a2fdf9db</guid><dc:creator>Drew Davis</dc:creator><description>&lt;p&gt;&lt;p&gt;
The name of the segment used for local variables varies depending
on the memory model (and thus the type of memory used for locals).
See the &amp;quot;Advanced Programming / Segment Naming Conventions /
Parameters and Local Variables&amp;quot; section of the Cx51 manual.&lt;/p&gt;

&lt;p&gt;
Small: ?DT?&lt;i&gt;function_name&lt;/i&gt;?&lt;i&gt;module_name&lt;/i&gt;&lt;br /&gt;
Large: ?XD?&lt;i&gt;function_name&lt;/i&gt;?&lt;i&gt;module_name&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Variables are stored in this segment in order of declaration.&lt;/p&gt;

&lt;p&gt;
All that said, I agree with the earlier advice: just write the
function in assembler and link it. Intermixing assembly code with a
high-level language just isn&amp;#39;t worth the development headache and
maintenance traps.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: use c variables in inline assembly</title><link>https://community.arm.com/thread/50475?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2007 14:03:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8dacf2d1-faf9-47ad-9cb4-80c6123501c2</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
1) not recommended (assembly in a separate module is much
better)&lt;br /&gt;
2) what is the problem?&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>