Microprocessor 8086 Assembly-Sum of two numbers
Microprocessor 8086 Assembly-Sum of two numbers
.model small
.data
msg1 db "Enter The First Number: $"
msg2 db 13,10,"Enter The Second Number: $"
msg3 db "The Sum is: $"
.data
msg1 db "Enter The First Number: $"
msg2 db 13,10,"Enter The Second Number: $"
msg3 db "The Sum is: $"
.code
mov ax,@data
mov ds,ax
mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,09h
int 21h
mov ah,09h
int 21h
mov ah,01h
int 21h
int 21h
mov bl,al
sub bl,30h
lea dx,msg2
mov ah,09h
int 21h
mov ah,09h
int 21h
mov ah,01h
int 21h
int 21h
mov bh,al
sub bh,30h
sub bh,30h
lea dx,msg3
mov ah,09h
int 21h
mov ah,09h
int 21h
add bl,bh
add bl,30h
add bl,30h
mov ah,02h
mov dl,bl
int 21h
mov dl,bl
int 21h
mov ah,4ch
int 21h
end
int 21h
end
Output
Enter The First Number: 5
Enter The Second Number:3
The Sum is: 8
The Sum is: 8
Comments
Post a Comment