title: How does this adding of two numbers works in Assembly
body: <p>I am new to assembly language and trying to understand a simple program which will add two nunbers and display the result.</p>
  
  <pre><code>section .data
  
  message1 db "value=%d%d",10,0
  
   section .text
     global main
     extern printf
     main:
     mov eax, 55
     mov ebx, 45
     add eax,ebx
     push eax
     push ebx
     push message1
     call printf
     add esp, 8
     ret
  </code></pre>
  
  <p>Now output comes out is 45 100 </p>
  
  <p>After add eax ebx instruction result will be stored in eax register.</p>
  
  <p>But now what happen in coming lines</p>
  
  <pre><code> push eax   // push 100 on to stack
  
   push ebx   // push 45 on to stack
  
   push message1  // push "value=%d" on to stack // I m bit doubtful here 
  </code></pre>
  
  <p>What I would like to know is what happen when "call printf" is executed??</p>
  
  <p>What is the puspose of "add esp,8"?? </p>