title: Solve the exercise of adding two numbers in assembly
body: <p>I want your help to solve this machine language exercise.</p>
  <blockquote>
  <p>Write a program in assembly language in which a procedure is defined that has two parameters and calculates the sum of the first parameter and the second parameter and puts it in the second parameter. Use this procedure to write a program that receives two one-digit numbers from the keyboard and displays the sum of the two. Suppose the sum of two numbers becomes one digit.</p>
  </blockquote>
  <hr />
  <p><strong>my code :</strong></p>
  <pre><code>nextline macro
      mov ah,2
      mov dl,13
      int 21h
      mov dl,10
      int 21h
  endm
  .MODEL SMALL
   .STACK 64
  
   .DATA
     msg1  DB  'Enter the character : $'
     msg2  DB  'The next character is : $'
     data1  dw  ?
  
   .CODE
     MAIN:
       MOV AX, @DATA             
       MOV DS, AX
  
       LEA DX, msg1           
       MOV AH, 9
       INT 21H
  
       MOV AH, 1                
       INT 21H
       mov data1,ax 
       
       push data1
       
       CALL NEXT_CHAR
       
       pop data1
                     
       nextline
       LEA DX, msg2          
       MOV AH, 9
       INT 21H
  
       MOV AH, 2                  
       MOV Dx, data1
       INT 21H
  
       MOV AH, 4CH                 
       INT 21H
  
  
  
  
   NEXT_CHAR PROC
  
      mov bp,sp
      push bx
                  
      MOV Bx, [bp+2]
      INC BL
      mov [bp+2],bx 
      
      pop bx
      RET           
   NEXT_CHAR ENDP
  
  END MAIN
  </code></pre>