<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to write an assembly function? in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732841#M2245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid that gcc doesn't have such functionality. You can use only inline assembly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can move your existing assembly code into .S file in S32DS project and call it from C code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2018 08:25:04 GMT</pubDate>
    <dc:creator>jiri_kral</dc:creator>
    <dc:date>2018-04-20T08:25:04Z</dc:date>
    <item>
      <title>How to write an assembly function?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732838#M2242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I am developing an embedded system with S32DS and I have a problem.&lt;/P&gt;&lt;P&gt;I have to write an&amp;nbsp;assembly function as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;asm volatile void OSPendSVException (void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;add sp, sp, #(9*4)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pop {pc}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;bx lr&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__asm void OSPendSVException1(void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;add sp, sp, #(9*4)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pop {pc}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;bx lr&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;__asm__ void OSPendSVException2(void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;add sp, sp, #(9*4)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; pop {pc}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;bx lr&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When compiling, the three functions above all have errors as below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="无标题.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/8194iFC6CAA9B5BFE9BB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="无标题.png" alt="无标题.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I wonder to know how to write&amp;nbsp;assembly function in S32DS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Apr 2018 14:00:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732838#M2242</guid>
      <dc:creator>zhouhl</dc:creator>
      <dc:date>2018-04-14T14:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an assembly function?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732839#M2243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in S32DS you can use GNU inline assembly syntax. For more details you can look here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.ic.unicamp.br/~celio/mc404-s2-2015/docs/ARM-GCC-Inline-Assembler-Cookbook.pdf" title="http://www.ic.unicamp.br/~celio/mc404-s2-2015/docs/ARM-GCC-Inline-Assembler-Cookbook.pdf"&gt;http://www.ic.unicamp.br/~celio/mc404-s2-2015/docs/ARM-GCC-Inline-Assembler-Cookbook.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Apr 2018 06:16:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732839#M2243</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2018-04-16T06:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an assembly function?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732840#M2244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jiri. Thank you very much for the help.&lt;/P&gt;&lt;P&gt;In the document about ARM and GCC, there are methods about how to write incline assembly code in C function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that the whole function should be written as assembly function instead of some statements are written in assembly code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This problem is in using the AutoSAR OS provided by NXP. In&amp;nbsp;Os_hw_core_compiler.h file, there are some functions as below:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;OSASM OSDWORD OSGETSTACKPOINTER_ (void)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; mr r3, r1&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The micro&amp;nbsp;&lt;EM style="background-color: #f6f6f6;"&gt;OSASM &lt;/EM&gt;is defined as:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;EM&gt;#if defined(OSDIABPPC)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#define OSASM __asm volatile&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#endif /* defined(OSDIABPPC) */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#if defined(OSCWPPC)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#define OSASM asm&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#endif /* defined(OSCWPPC) */&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#if defined(OSGHSPPC)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#define OSASM asm&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#endif /* defined(OSGHSPPC) */&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In S32DS, I could not figure out how to define to &lt;EM style="background-color: #f6f6f6;"&gt;OSASM &amp;nbsp;&lt;/EM&gt;write a whole assembly function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me about above problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;Have a nice work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2018 02:58:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732840#M2244</guid>
      <dc:creator>zhouhl</dc:creator>
      <dc:date>2018-04-18T02:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to write an assembly function?</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732841#M2245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm afraid that gcc doesn't have such functionality. You can use only inline assembly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can move your existing assembly code into .S file in S32DS project and call it from C code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jiri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2018 08:25:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/How-to-write-an-assembly-function/m-p/732841#M2245</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2018-04-20T08:25:04Z</dc:date>
    </item>
  </channel>
</rss>

