title: Byte vs Long vs word in GAS assembly
body: <p>This code is accessing all elements correctly(like this): </p>
  
  <pre><code>.data
    s : .long 7,2,3,5
  
  .text
  .globl _start
  
  _start:
  
          movl s+4,%eax    # second number in s
          movl $1,%eax
          movl $0,%ebx
          int $0x80
  </code></pre>
  
  <p>But this code gives garbage : </p>
  
  <pre><code>.data
    s : .word 7,2,3,5
  
  .text
  .globl _start
  
  _start:
  
          movl s+4,%eax    # third number in s
          movl $1,%eax
          movl $0,%ebx
          int $0x80
  </code></pre>
  
  <p>I am using 64-bit Linux using GAS assembler and using gdb for debugging and checking the register values.</p>
  
  <p><code>long</code> displays exact value while <code>word</code> and <code>byte</code> give garbage value. <code>display s</code> gives <code>7</code> for <code>long</code> but 131079 for <code>word</code>.</p>
  
  <p>I am new to this, is <code>word</code> not used in GAS or is there a type conversion going on?</p>