954,479 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Mr

:) hi guys and family members of daniweb. i am doing computer system. I like to work you guys, my difficulty is based on digital systems using 8051,microprocessor 8086.
i love to build projects using 8051 but my is obstacle are programming site.
previous weeks ago i was having difficulty to displaying my answer in decimal eg my program is incomplete , it only display (1+1)=b error
it suppose to display (1+1)= 2 correct.

;adding two numbers and display the sum

.model small
.stack 100h
.data
enter1 db 'Please enter first number ',13,10,'$'
enter2 db 'Please enter second number ',13,10,'$'
.code

mov ax,@data
mov ds,ax
mov dx,offset enter1
mov ah,9h
int 21h
mov ah,1h
int 21h
mov bl,al

mov ax,@data
mov ds,ax
mov dx,offset enter2
mov ah,9h
int 21h
mov ah,1h
int 21h
mov cl,al

add cl,bl

mov dl,cl
mov ah,2h
int 21h

mov ax,4c00h
int 21h
end

brianbk
Newbie Poster
1 post since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

You need to convert the ascii digits, read in by your program, into the corresponding binary numbers before adding them, and then convert the result back into an ascii string before displaying the result.

mathematician
Junior Poster
161 posts since Nov 2006
Reputation Points: 14
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You