You are on page 1of 2

.

model small
.stack 100h
.data
str1 db "enter a character : $"
str_alpha db "You entered alphabet. $"
str_num db "You entered digit.$"
str_hash db "You entered hash.$"
str_star db "You entered astaric.$"
str_dolar db "You entered dollar.$"
str_perc db "You entered percentage sign.$"
str_other db "You entered some other character.$"
.code
main proc
mov ax,@data
mov ds,ax
lea dx,str1
mov ah,9h
int 21h
mov ah,2h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
mov ah,1h
int 21h
mov ah,2h
mov dl,0dh
int 21h
mov dl,0ah
int 21h
cmp al , 'A'
je ALPHA
cmp al , 'Z'
jle APLHA
cmp al , 'a'
je ALPHA
cmp al , 'a'
jle APLHA
cmp al , '0'
je NUMBER
cmp al , '9'
jle NUMBER
cmp al , '*'
je ASTARIC
cmp al , '#'
je HASH
cmp al , '$'
je DOLLAR
cmp al , '%'
je PERCNT
je OHER
ALPHA:
lea dx , atr_alpha
mov ah , 09h
int 21h
jmp EXIT
NUMBER:
lea dx , atr_num
mov ah , 09h
int 21h
jmp EXIT
ASTARIC:
lea dx , atr_star
mov ah , 09h
int 21h
jmp EXIT
HASH:
lea dx , atr_hash
mov ah , 09h
int 21h
jmp EXIT
DOLLAR:
lea dx , atr_dolar
mov ah , 09h
int 21h
jmp EXIT
PERCNT:
lea dx , atr_perc
mov ah , 09h
int 21h
jmp EXIT
OTHER:
lea dx , atr_other
mov ah , 09h
int 21h
jmp EXIT
EXIT:
mov ax ,4c00h
int 21h
main endp
end main

You might also like