<?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>LPC MicrocontrollersのトピックRe: Global constant in GNU AS</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878154#M35121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The standard way of doing this is to place them in an (assembler) include file, and include that file into each assembler file where it is needed.&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;.include “file.h”&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Mar 2019 22:16:32 GMT</pubDate>
    <dc:creator>converse</dc:creator>
    <dc:date>2019-03-27T22:16:32Z</dc:date>
    <item>
      <title>Global constant in GNU AS</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878152#M35119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an assembler program consisting of several partial programs.&lt;/P&gt;&lt;P&gt;I know that labels have to be declared as "global" so that other partial programs can see them:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;label: LDR R0,[R1]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;can only be seen by the same partial program&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.global label&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;label: LDR R0,[R1]&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;can be seen by all the partial programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't seem to get the same thing to work for constants:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.equ v_charge,2400&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;sets the constant v_charge to 2400.&lt;/P&gt;&lt;P&gt;If I put it in its own file and&lt;STRONG&gt; .include&lt;/STRONG&gt; the file in all the partial programs that need it, then it works, but as a line of code in a partial program it is only available to its local program&lt;/P&gt;&lt;P&gt;I would expect that&lt;STRONG&gt; .global v_charge&amp;nbsp;&lt;/STRONG&gt;would&amp;nbsp;make it available to the other partial programs, but it doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the correct syntax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 15:20:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878152#M35119</guid>
      <dc:creator>ianbenton</dc:creator>
      <dc:date>2019-03-21T15:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Global constant in GNU AS</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878153#M35120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;Hi Ian,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;I analyzed the disassembly view trying to&amp;nbsp;declare a global constant to other files and it looks like the compiler put the value from the constant in the assembly instruction, ignoring the label. I suspect this can't be done.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in; font-family: 'Helvetica Neue'; font-size: 11.25pt; color: #3d3d3d;"&gt;&lt;SPAN style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;Alexis Andalon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 20:35:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878153#M35120</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-03-27T20:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Global constant in GNU AS</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878154#M35121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The standard way of doing this is to place them in an (assembler) include file, and include that file into each assembler file where it is needed.&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;.include “file.h”&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Mar 2019 22:16:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878154#M35121</guid>
      <dc:creator>converse</dc:creator>
      <dc:date>2019-03-27T22:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Global constant in GNU AS</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878155#M35122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Alexis and Con Verse. I tried a few options and the include file is the only thing I could get to work.&lt;/P&gt;&lt;P&gt;. . .&amp;nbsp; but (on a point of semantics) I'm never sure whether it should be .h or .inc&lt;/P&gt;&lt;P&gt;I do know that the standard LPCXpresso editor seems to think every line is a syntax error and underlines it in orange, and that's mildly irritating!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 11:53:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878155#M35122</guid>
      <dc:creator>ianbenton</dc:creator>
      <dc:date>2019-03-28T11:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Global constant in GNU AS</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878156#M35123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems to work apart from one thing:&lt;/P&gt;&lt;P&gt;If ever you edit&amp;nbsp; "file.h" the new version only takes effect in the sub-programs that have recently been edited. If the program is complied with some sub-programs the same as the previous compilation, then those sub-programs retain the old version of file.h.&lt;/P&gt;&lt;P&gt;That's annoying!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2019 10:33:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Global-constant-in-GNU-AS/m-p/878156#M35123</guid>
      <dc:creator>ianbenton</dc:creator>
      <dc:date>2019-04-30T10:33:27Z</dc:date>
    </item>
  </channel>
</rss>

