title: Inline assembly in C with Turbo C 3.0 - how to get address of a label
body: <p>I'm trying to get address of a label - here is some sample code:</p>
  
  <pre><code>int main() {
      asm {
          mov ax,1
          mov bx,ax
      }
    _labelname:
      asm {
          mov ax, OFFSET _labelname
      }
  
      return 0;
  }
  </code></pre>
  
  <p>Compilation of this code returns this error: "Undefined symbol _labelname"
  If I define the label in asm block, I can't even use 
      <em>jmp _labelname</em></p>
  
  <p>I found <a href="http://www.codeproject.com/Messages/3186795/Re-Label-adresses-in-inline-assembly.aspx" rel="nofollow noreferrer">this</a> and doesn't work, for <a href="https://stackoverflow.com/questions/1897401/gnu-assembler-get-address-of-label-variable-intel-syntax">this</a>, no way actually. <a href="http://msdn.microsoft.com/en-us/library/78cxesy1(v=vs.80).aspx" rel="nofollow noreferrer">This</a> says just jumping, not addressing. And <a href="https://stackoverflow.com/questions/209198/borland-x86-inlined-assembler-get-a-labels-address">this</a> doesn't help at all. Any suggestions?</p>