title: Addition of two 8-bits number in 8086 using MASM
body: <p>This is the code that I have written in 8086 using MASM. The code is for simple addition of two 8-bit numbers (no need to worry about carry). I gave for input to the following program, two numbers: 31h and 16h . The output should have been 47h but it is giving me the output as 'w'. The code works fine if I take numbers whose some does not exceed 9, can someone please point out my mistake here?</p>
  
  <p>CODE:</p>
  
  <pre><code>data segment
     n1 db 31h
     n2 db 16h
  data ends
  
  code segment
   assume cs:code, ds:data
    start:
  
     mov ax,data
     mov ds,ax
  
     mov al,n1
     mov bl,n2
     add al,bl
  
     add al,30h
     mov dl,al
  
     mov ah,02h
     int 21h
  
     mov ah,4ch
     int 21h
  
  code ends
  end start
  </code></pre>