title: Adding Two Numbers from Input
body: <p>I'm trying to write this little program which accepts 2 integers and adds them and displays them to the user. I manage to write the entire program and save the variables (<code>number1</code>, <code>number2</code>), and now I have to store <code>number1 + number2</code> in <code>result</code>.</p>
  
  <h2>Here's the code. Where does the add function go?</h2>
  
  <pre><code>segment .data 
  
      msg db "Please enter a digit ", 0xA,0xD 
      len equ $ - msg 
  
  segment .bss
  
      number1 resb 10 
      number2 resb 10 
      result resb 10    
  
  segment .text 
  
      msg2 db "Please enter a second digit", 0xA,0xD 
      len2 equ $ - msg2 
  
      msg3 db "The sum is : ", 0xA,0xD 
      len3 equ $ - msg3
  
  global _start 
  
   _start: 
  
      mov eax, 4         
      mov ebx, 1         
      mov ecx, msg         
      mov edx, len 
      int 0x80                
  
      mov eax, 3 
      mov ebx, 0  
      mov ecx, number1 
      mov edx, 10 
      int 0x80            
  
      mov eax, 4        
      mov ebx, 1         
      mov ecx, msg2          
      mov edx, len2         
      int 0x80
  
      mov eax, 3  
      mov ebx, 0  
      mov ecx, number2 
      mov edx, 10 
      int 0x80        
  
      mov eax, 4         
      mov ebx, 1         
      mov ecx, msg3          
      mov edx, len3         
      int 0x80
  
      ;add result, number1
      ;add result, number2 
  
      mov eax, 4        
      mov ebx, 1 
  
      mov ecx, $result         
      mov edx, len3         
      int 0x80
  
  
  exit:    
      mov eax, 1   
      xor ebx, ebx 
      int 0x80  
  </code></pre>