title: Assembly: Is it possible to move (mov) value of variable to memory address?
body: <p>According to <a href="https://www.ethicalhacker.net/columns/heffner/intro-to-assembly-and-reverse-engineering" rel="nofollow noreferrer">https://www.ethicalhacker.net/columns/heffner/intro-to-assembly-and-reverse-engineering</a></p>
  
  <pre><code>mov 0xffffffb4,0x1
  </code></pre>
  
  <blockquote>
    <p>moves the number 1 into 0xffffffb4.</p>
  </blockquote>
  
  <p>The problem is, when I tried it with the following C code, </p>
  
  <pre><code>int a = 1;
  int b = 13;
  int c = 133;
  </code></pre>
  
  <p>The assembly language equivalent to that code is like this. (I've got this from GDB)</p>
  
  <pre><code>   0x00000000004004ee &lt;+8&gt;:     mov    DWORD PTR [rbp-0x4],0x1
     0x00000000004004f5 &lt;+15&gt;:    mov    DWORD PTR [rbp-0x8],0xd
     0x00000000004004fc &lt;+22&gt;:    mov    DWORD PTR [rbp-0xc],0x85
  </code></pre>
  
  <p>Note that my assembly code moves the number 1 into register RBP.</p>
  
  <p>However, according to the note from that URL, it moves the number 1 into 0xffffffb4 and 0xffffffb4 looks like memory address.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Is it possible to moves number 1 to memory address instead of register as mentioned in the note?</li>
  </ol>
  
  <p>I've also tested this on Immunity Debugger and found that the value of the variable is moved to the register ESP.</p>
  
  <ol start="2">
  <li>Why GDB moves the value to Base Pointer (RBP) while Immunity Debugger moves it to Stack Pointer (ESP)?</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/oFXuJ.jpg" rel="nofollow noreferrer">Click here for Immunity Debugger screenshot</a></p>