Created
February 12, 2016 22:23
-
-
Save abrarShariar/37d1a79dc849c0658a3d to your computer and use it in GitHub Desktop.
input char and check for vowel. Print 1 for vowel 0 otherwise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;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