title: Need Interpretation of 64bit Assembly Instruction As Opposed to 32bit
body: <p>I am going through the book Hacking : The Art of Exploitation which uses 32bit assembly, and my machine is 64 bit. Now I understand that's not a great thing, but this is the question.</p>
  <p>As I debug this program,</p>
  <pre><code>  Reading symbols from ./a.out...
  (gdb) break main
  Breakpoint 1 at 0x113d: file first.c, line 6.
  (gdb) run
  Starting program: /home/kingvon/Desktop/asm/a.out 
  
  Breakpoint 1, main () at first.c:6
  6               for(i=0; i &lt; 10; i++){
  (gdb) x/3i $rip
  =&gt; 0x55555555513d &lt;main+8&gt;:     movl   $0x0,-0x4(%rbp)
     0x555555555144 &lt;main+15&gt;:    jmp    0x555555555156 &lt;main+33&gt;
     0x555555555146 &lt;main+17&gt;:    lea    0xeb7(%rip),%rdi        # 0x555555556004
  </code></pre>
  <p>this is what I see on my machine(64 bit),</p>
  <pre><code>0x55555555513d &lt;main+8&gt;:     movl   $0x0,-0x4(%rbp)
  </code></pre>
  <p>but in the example(32 bit) given it says:</p>
  <pre><code>0x55555555513d &lt;main+8&gt;:     mov   DWORD PTR [ebp-4],0x0
  </code></pre>
  <p>From reading the 32 bit assembly it is quite clear that this should mean that the machine will move the value of 0 into memory location stored in the EBP register minus 4. I am aware both instructions do the same things, but I feel the 64 instruction does not look like what it really means. How can the 64 instruction interpreted/worded? I am aware that the register names are different on 64 bit</p>