how to subtract two unsigned numbers in 8086 assembly language.


.model small
.stack 100h
.data
n1 db "Enter first no:$"
n2 db 10d,"Enter second no:$"
ans db 10d,"Subtraction is:$"
.code
mov ax,@data
mov ds,ax


mov ah,9
mov dx,offset n1
int 21h
CALL input1


mov ah,9
mov dx,offset n2
int 21h
CALL input2


mov ah,9
mov dx,offset ans
int 21h
sub bl,al

add bl,48
mov dl,bl
mov ah,2
int 21h


mov ah,4ch
int 21h


input1 PROC
mov ah,1
int 21h
mov bl,al
RET
input1 ENDP


input2 PROC
mov ah,1
int 21h
RET
input2 ENDP
ends
end

Output:
how to subtract two numbers in assembly language, subtraction of two numbers in assembly language

Comments