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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.