org 100h jmp start inp1 db 'Enter first number: ',24h inp2 db 0dh,0ah,'Enter second number: ',24h out1 db 0dh,0ah,0dh,0ah,'The first inputted number: ',24h out2 db 0dh,0ah,'The second inputted number: ',24h sum db 0dh,0ah,0dh,0ah,'The sum is: ',24h start: mov ah,9 mov dx,inp1 int 21h mov ah,1 int 21h mov dl,al mov [1],dl ;input first number mov ah,9 mov dx,inp2 int 21h mov ah,1 int 21h mov [2],al ;input second number mov ah,9 mov dx,out1 int 21h mov dx,[1] ;output first number mov ah,2 int 21h mov ah,9 mov dx,out2 int 21h mov dx,[2] ;output second number mov ah,2 int 21h mov ah,9 mov dx,sum int 21h mov dl,[1] mov bl,[2] sub dl,30h ;here's my problem... if the sum is one digit it gives the correct answer, but if the sum is 2 digit integer, it gives an incorrect answer.. help plzz sub bl,30h add dl,bl add dl,30h mov ah,2 int 21h mov ah,0 int 16h int 20h
edit by ishkabible: please use code tags when posting code. like so,
This post has been edited by ishkabible: 18 July 2011 - 11:09 AM

New Topic/Question
This topic is locked
MultiQuote











|