This is an assembly language program for 8086 microprocessor in which user gives two data as input and the program finds its sum. Here, only one digit data is permitted. What we input here is in ASCII value, so we subtract by 48 before addition; and add by 48 after addition so that we can properly display the value in decimal value.
.model small
.data
str1 db "Enter first number: $"
str2 db 13,10,"Enter second number: $"
str3 db 13,10,"The sum is: $"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,str1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
lea dx,str2
mov ah,9
int 21h
mov ah,1
int 21h
mov bh,al
sub bh,48
sub bl,48
lea dx,str3
mov ah,9
int 21h
add bh,bl
add bh,48
mov dl,bh
mov ah,2
int 21h
mov ah,4Ch
int 21h
main endp
end
.data
str1 db "Enter first number: $"
str2 db 13,10,"Enter second number: $"
str3 db 13,10,"The sum is: $"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,str1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
lea dx,str2
mov ah,9
int 21h
mov ah,1
int 21h
mov bh,al
sub bh,48
sub bl,48
lea dx,str3
mov ah,9
int 21h
add bh,bl
add bh,48
mov dl,bh
mov ah,2
int 21h
mov ah,4Ch
int 21h
main endp
end
nice
ReplyDeletexoss
DeleteWhere is explanation?
Deletecse22
ReplyDelete134
ReplyDeleteonek kothin
ReplyDeleteAmma Behen pe ajaunga
Deletesabbir chutiya hay
ReplyDelete840
Deletetmr kopale bou jutbe na baba
Deletetumao koaple koto ou jutbe jana ase amago
Deletesakib tmi ekta bolod
ReplyDeleteprituni
ReplyDeleteprituni
ReplyDeleteCSE-22 Rocks
ReplyDeleteHabib shobceye boro bolod!
ReplyDeletesamianiii bolod
ReplyDeletep...........h
ReplyDeleteera chira
ReplyDeleteera khay chira
ReplyDeletekutti pritu
Deletesussy
ReplyDeletehow to modify this? I want to sum numbers over 10
ReplyDeleteplease sleep well..take rest
Deletemm
ReplyDeleteburh
ReplyDeletebhangar che
ReplyDeleteYou Could Better Explain The Procedure As Well,So That One Can Understand Properly.
ReplyDeleteAong sing nu marma Tui Ki kokono Valo Hobi Nah??????????????
ReplyDeletebaal dao bujhi nai
ReplyDelete<a href = "https://madhink.com></a> go here
ReplyDeletechutiya bana diya re
ReplyDelete