Code:
.model small
.stack 100h
.data
msg db 'Enter the character $'
msg1 db 'In lower Case $'
msg2 db 'In upper case $'
msg3 db 'Invalid input'
.code
main proc
mov ax,@data
mov ds,ax
lea dx,msg
mov ah,9
int 21h
mov ah,1
int 21h
mov bl,al
cmp bl,'a'
jae c1
cmp bl,'A'
jae c3
jmp exit
c1:
lea dx,msg2
mov ah,9
int 21h
cmp bl,'z'
jbe c2
jmp exit:
c2:
sub bl,20h
mov ah,2
mov dl,bl
int 21h
jmp exit
c3:
lea dx,msg1
mov ah,9
int 21h
cmp bl,'Z'
jbe c4
jmp exit
c4:
add bl,20h
mov ah,2
mov dl,bl
int 21h
exit:
LEA DX,msg3
mov ax,9
int 21h
mov ah,4ch
int 21h
Output:
0 Comments