Skip to content

Instantly share code, notes, and snippets.

@shemul
Created March 30, 2015 13:39
Show Gist options
  • Save shemul/cc1a24ed7ffe6db35055 to your computer and use it in GitHub Desktop.
Save shemul/cc1a24ed7ffe6db35055 to your computer and use it in GitHub Desktop.
vowel , consonant , number test
.MODEL SMALL
.STACK 100H
.DATA
input_line db ?
MSG1 DB 'Enter Char : $'
str1 db ' is a vowel$'
str2 db ' is a consonant$'
str3 db ' is a number$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX , MSG1
MOV AH , 9
INT 21H
begin:
MOV AH , 1
INT 21H
MOV BL , AL
mov input_line,al
cmp input_line,'a'
je vowel
cmp input_line,'e'
je vowel
cmp input_line,'i'
je vowel
cmp input_line,'o'
je vowel
cmp input_line,'u'
je vowel
cmp input_line,'0'
je number
cmp input_line,'1'
je number
cmp input_line,'2'
je number
cmp input_line,'3'
je number
cmp input_line,'4'
je number
cmp input_line,'5'
je number
cmp input_line,'6'
je number
cmp input_line,'7'
je number
cmp input_line,'8'
je number
cmp input_line,'9'
je number
jmp conso
vowel:
LEA DX , str1
MOV AH , 9
INT 21H
jmp exit
conso:
LEA DX , str2
MOV AH , 9
INT 21H
jmp exit
number:
LEA DX , str3
MOV AH , 9
INT 21H
jmp exit
;TERMINATE THE PROG
exit:
MOV AH , 4CH
INT 21H
MAIN ENDP
END MAIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment