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: $"
.code
mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,09h
int 21h
mov ah,01h
int 21h
mov bl,al
sub bl,30h
lea dx,msg2
mov ah,09h
int 21h
mov ah,01h
int 21h
mov bh,al
sub bh,30h
lea dx,msg3
mov ah,09h
int 21h
add bl,bh
add bl,30h
mov ah,02h
mov dl,bl
int 21h
mov ah,4ch
int 21h
end

Output
Enter The First Number: 5
Enter The Second Number:3
The Sum is: 8

Comments

Popular posts from this blog

Introduction to C++ Programming Language

The Assembly Process Of 8086 Microprocessor-Two Pass Assembling Steps

Installing 8086 Assembler on a Computer