title: GCC Inline-assembly: call dword ptr
body: <p>If I have the following code in Windows VC++:</p>
  
  <pre><code>DWORD somevar = 0x12345678;
  _asm call dword ptr [somevar]
  </code></pre>
  
  <p>How can I make the same thing in GCC inline-assembly, with AT&amp;T syntax?</p>
  
  <pre><code>__asm__ __volatile__ (
      "call dword ptr [%%edx]" : :
      "d" (somevar)
  );
  </code></pre>
  
  <p>I've tried something like this, but it generates an "junk" error...</p>
  
  <p>And then I tried to pass <code>somevar</code> to some registers, and then convert it to <code>dword</code>, <code>ptr</code>, etc, but I couldn't get it to work.</p>
  
  <p><strong>UPDATE:</strong> I found something that would be useful, like it seems that we have to use parenthesis instead of brackets in that case, and I found something with <code>lcall</code> to call as <code>far</code>. But I still can't understand how I can reproduce <code>dword ptr</code>.</p>