title: using value of external variables in assembly
body: <p>I'm having a bit of trouble working with <code>.extern</code> variables in assembly. How can I get their value to put into a register?</p>
  <pre><code>.extern a, b, c
  .global main
  
  .text
  main:
    mov *value of a*, %rax
      ret
  </code></pre>
  <p>I've tried the following:</p>
  <ol>
  <li>putting sign before a: <code>.a</code>, <code>$a</code>, <code>a[0]</code>, <code>a[1]</code>, <code>*a</code></li>
  <li>trying to treat <code>.extern</code> as a label <code>.extern+2</code> etc'</li>
  <li>also tried <code>.extern a</code></li>
  </ol>
  <p>I think I don't quite understand what the meaning of <code>.extern</code> is and how to access it. I've tried reading Intel's manual but I couldn't find any information online which regards what I need - I guess I didn't know how to write my question properly since I don't know what <code>.extern</code> is.</p>
  <p>If anyone could refer me to information about it and how to use it I would be very grateful.</p>