0

:) 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

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by mathematician
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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.