title: Call atoi (Assembler) printf (Assembler)
body: <p>I'm practicing programming in Assembly, making code C.
  I don't understand the conversion of a parameter to an integer using atoi.
  Can someone explain to me how I as interpret the following code segment:</p>
  
  <pre><code>movl    12(%ebp), %eax  ; move a parameter to %eax
  addl    $4, %eax        ; add 4 bytes
  movl    (%eax), %eax    ; magic things
  movl    %eax, (%esp)    ; magic things
  call    atoi            ; atoi call
  movl    %eax, 24(%esp)  ; asign the result of a magic procedure to a new variable
  </code></pre>
  
  <p>I understand some instructions, but the magic procedures are a little bit ambiguous to me.</p>
  
  <p>Also, I want to know how works the call to the function printf, this is the segment of the code:</p>
  
  <pre><code>movl    $.LC1, %eax  ; assing the string (%d\n) to %eax
  movl    28(%esp), %edx  ; move the value to print to %edx
  movl    %edx, 4(%esp)   ; magic things
  movl    %eax, (%esp)    ; magic things
  call    printf          ; call to printf
  </code></pre>
  
  <p>Thanks in advance for the support.</p>