title: GDB: Printing binary values omits leading zero?
body: <p>I'm writing some simple assembly programs with the y assembler. However, I've noticed that although I can examine binary values in memory just fine, printing them (in the registers) omits a leading zero. This keeps catching me off guard, and so I'm wondering if there is a reason for it.</p>
  
  <hr>
  
  <h3>Program</h3>
  
  <pre><code>    segment .data
  
  f   dd  2.25        ; 32-bit floating point.
  
      segment .text
      global main
  
  main:
      mov eax, [f]
      xor rax, rax
      ret
  </code></pre>
  
  <hr>
  
  <h3>GDB</h3>
  
  <p>After setting a break point on the line corresponding to <code>mov eax, [f]</code>, I get the following binary value using the examine command:</p>
  
  <pre><code>(gdb) x/1tw &amp;f
  0x601030:   01000000000100000000000000000000
  </code></pre>
  
  <p>I have manually verified this. However, the print command yields something different once it is loaded into the <code>eax</code> register:</p>
  
  <pre><code>(gdb) p/t $eax
  $2 = 1000000000100000000000000000000
  </code></pre>
  
  <p>The former is 32 bits, while the latter is 31. The leading zero is omitted. Am I doing something wrong in displaying these values? </p>