title: assembly "mov" instruction
body: <p>I'm learning assembly by comparing a c program to its assembly equivalent.</p>
  
  <p>Here is the code.</p>
  
  <pre><code>.file   "ex3.c"
  .section    .rodata
  .LC0:
      .string "I am %d years old.\n"
  .LC1:
      .string "I am %d inches tall.\n"
      .text
      .globl  main
      .type   main, @function
  main:
      pushl   %ebp    //establish stack frame//
      movl    %esp, %ebp //move esp into ebp, all contents saved down stack//
      andl    $-16, %esp //16 from esp for local var space//
      subl    $32, %esp//stack frame reserving - 32 bytes//
      movl    $10, 24(%esp)
      movl    $72, 28(%esp)
      movl    24(%esp), %eax
      movl    %eax, 4(%esp)
      movl    $.LC0, (%esp)
      call    printf
      movl    28(%esp), %eax
      movl    %eax, 4(%esp)
      movl    $.LC1, (%esp)
      call    printf
      movl    $0, %eax
      leave
      ret
      .size   main, .-main
      .ident  "GCC: (Ubuntu 4.8.2-19ubuntu1) 4.8.2"
      .section    .note.GNU-stack,"",@progbits
  </code></pre>
  
  <p>For this line:</p>
  
  <pre><code>movl    $10, 24(%esp)
  </code></pre>
  
  <p>If I understand it correctly it is saying move the value of 10 into the esp register. But what is the 24 doing? I don't think it is moved into esp because a value to be moved is denoted by "$" (i think)</p>