.model small
.stack 100h
.data
msg1 db 10,13,'Enter char=$'
msg2 db 10,13,'Smallest Char=$'
.code
main proc
mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
lea dx,msg1
mov ah,9
int 21h
mov ah,1
int 21h
mov cl,al
lea dx,msg1
mov ah,9
int 21h
mov ah,1
int 21h
mov bh,al
cmp bl,cl
jbe s1
jmp s2
s1:
cmp bl,bh
jbe print1
jmp print3
s2:
cmp cl,bh
jbe print2
jmp print3
print1:
lea dx,msg2
mov ah,9
int 21h
mov dl,bl
mov ah,2
int 21h
jmp exit
print2:
lea dx,msg2
mov ah,9
int 21h
mov dl,cl
mov ah,2
int 21h
jmp exit
print3:
lea dx,msg2
mov ah,9
int 21h
mov dl,bh
mov ah,2
int 21h
jmp exit
exit:
mov ah,4ch
int 21h
main endp
end main
0 comments:
Post a Comment