title: Inline assembly troubles
body: <p>I tried to compile with <strong>GCC</strong> inline assembly code which compiled fine with <strong>MSVC</strong>, but got the following errors for basic operations:</p>
  
  <pre><code>// var is a template variable in a C++ function
  __asm__
  {
      mov edx, var //error: Register name not specified for %edx
      push ebx //error: Register name not specified for %ebx
      sub esp, 8 //error: Register name not specified for %esp
  }
  </code></pre>
  
  <p><BR>
  After looking through <a href="http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html" rel="nofollow">documentation</a> covering the topic, I found out that I should probably convert (even if I am only interested in x86) <strong>Intel</strong> style assembly code to <strong>AT&amp;T</strong> style. However, after trying to use <strong>AT&amp;T</strong> style I got even more weird errors:</p>
  
  <pre><code>mov var, %edx //error: Expected primary-expression before % token
  mov $var, edx //error: label 'LASM$$s' used but not defined
  </code></pre>
  
  <p><BR>
  I should also note that I tried to use <strong>LLVM-GCC</strong>, but it failed miserably with internal errors after encountering inline assembly.</p>
  
  <p>What should I do?</p>