Skip to content

Instantly share code, notes, and snippets.

@abrarShariar
Created February 12, 2016 22:23
Show Gist options
  • Select an option

  • Save abrarShariar/37d1a79dc849c0658a3d to your computer and use it in GitHub Desktop.

Select an option

Save abrarShariar/37d1a79dc849c0658a3d to your computer and use it in GitHub Desktop.
input char and check for vowel. Print 1 for vowel 0 otherwise
;input char and check for vowel. Print 1 for vowel 0 otherwise
.model small
.stack 100h
.data
char db ?
vow db 30h
.code
main proc
mov ax,@data
mov ds,ax
INPUT:
mov vow,30h
mov ah,01
int 21h
mov char,al
cmp char,'a'
je VOWEL
cmp char,'e'
je VOWEL
cmp char,'i'
je VOWEL
cmp char,'o'
je VOWEL
cmp char,'u'
je VOWEL
jmp OUTPUT
VOWEL:
add vow,1
OUTPUT:
mov ah,02 ;print char
mov dl,vow
int 21h
mov dl,09h
int 21h
jmp INPUT
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