title: How to declare and initialize local variables in gcc inline assembly without extended inline asm?
body: <p>I know this is a very basic question but I am really stuck on it. In fact I am absolutely newbie in GCC syntax.</p>
  
  <p>I want to have local variables (Stack addresses with labels) without using extended inline assembly. Something like the following code in Intel syntax:</p>
  
  <pre class="lang-none prettyprint-override"><code>DATA1  DB  100 
  MOV AL, DATA1
  </code></pre>
  
  <p>This is the code I guess may substitute in GCC:</p>
  
  <pre class="lang-c prettyprint-override"><code>int someFunction(int x)
  {
      __asm__ volatile(
                       "function1:"
                       ".data;"
                       ".2byte $4 data1   ;"
  
                       ".text;"
                       "pushq %rbp;"
                       "movq %rsp , %rbp ;"
  
                       "movl var , %eax;"  // this is source of error
  
                       "popq %rbp;"
                       "leaveq;"
                       "retq ; "
                      ); 
  }
  </code></pre>
  
  <p>But this code results in this error:</p>
  
  <blockquote>
    <p>symbol(s) not found for architecture x86_64</p>
  </blockquote>
  
  <p>I can use global variables in x86 but the same result comes in x64 or x86_x64.</p>
  
  <p>Setting:  LLVM 4.1; Cocoa used in Xcode 4 </p>
  
  <p>What is the correct syntax?</p>