title: C Macro - how to get an integer value into a string literal
body: <p>Is it possible to get the value of a #defined <em>integer</em> symbol to be inserted verbatim into a string literal that is part of an assembly section in GCC (AVR Studio)?</p>
  
  <p>I want the "LEDS" to be replaced by 48 within the string literal inside the asm() block below.</p>
  
  <pre><code>#define LEDS 48 //I only want ONE mention of this number in the source
  int x = LEDS;   //I'm using the value directly too
  
  void DrawFrame()
  {
      asm(
      "ldi        R27, 0x00       \n\t"
      "ldi        R26, 0x00       \n\t"
      "ldi        R18, LEDS       \n\t" //&lt;-- substitution needed here
  ...
  }
  </code></pre>
  
  <p>But I want the compiler/assembler (after the preprocessor has done it's job) to see this...</p>
  
  <pre><code>#define LEDS 48 //I only want ONE mention of this number in the source
  int x = LEDS;   //I'm using the value directly too
  
  void DrawFrame()
  {
      asm(
      "ldi        R27, 0x00       \n\t"
      "ldi        R26, 0x00       \n\t"
      "ldi        R18, 48         \n\t" //&lt;-- substitution needed here
  ...
  }
  </code></pre>
  
  <p>So far I have tried all the macro tricks I can think of (#stringification, arg substitution and even #including files with various combinations of values and double quotes and whatnot).</p>
  
  <p>I'm not at all familiar with the magic of inlining AVR assembly code into AVR Studio's GCC compiler.</p>
  
  <p>I'm trying to avoid having multiple occurrences of the "48" literal in my source, if the preprocessor can perform this substitution for me that would be great.</p>
  
  <p>Edit:  This is for a microcontroller firmware project - and just to make life interesting, there is almost no spare room for new code to be added.</p>