-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvowel_and_cons.asm
More file actions
87 lines (63 loc) · 1.41 KB
/
vowel_and_cons.asm
File metadata and controls
87 lines (63 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
;write a program to reas a string from user and display vowels and consonants seperately
.model small
.stack 64
.data
MAXLEN DB 255
ACTLEN DB ?
INPUT DB 255 DUP('$')
vowel db 255 DUP('$')
cons db 255 DUP('$')
NEW_LINE MACRO
mov ah, 02h
mov dl, 0ah
int 21h
mov dl, 0dh
int 21h
NEW_LINE ENDM
.code
main proc far
mov ax, @data
mov ds, ax
mov ah, 0ah
lea dx, MAXLEN
int 21h
NEW_LINE
mov ch, 0
mov cl, actlen
lea si, input
lea di, vowel
lea bx, cons
l1:
mov al, [si]
cmp al, 32
je skip
cmp al, 'a'
je store_v
cmp al, 'e'
je store_v
cmp al, 'i'
je store_v
cmp al, 'o'
je store_v
cmp al, 'u'
je store_v
mov [bx], al
inc bx
jmp skip
store_v:
mov [di], al
inc di
skip:
inc si
loop l1
mov ah, 09h
lea dx, vowel
int 21h
NEW_LINE
mov ah, 09h
lea dx, cons
int 21h
mov ah, 4Ch
int 21h
main endp
end