New to assembly and very stuck on how do this:
I have a user specified array. The user inputs the length and the characters. My problem is I need move all the vowels to the beginning of the array.
This is my current progress
INCLUDE Irvine32.inc
.data
ProgInfo BYTE " ",0Ah
BYTE "------------------------------------------------------",0Ah
BYTE "This program will reorder an array of characters",0Ah
BYTE "all vowels will be moved to the beginning of the array",0Ah
BYTE "------------------------------------------------------",0Ah
BYTE " ",0
Prompt1 BYTE "Please enter the number of characters to be inputed: ",0
NChars DWORD ? ;Unitialized for user input
myarray BYTE ?
Prompt2 BYTE "Please enter a string of characters: ",0
Reordered BYTE " ",0Ah
BYTE "The reordered array is: ",0
.code
main PROC
mov edx, OFFSET ProgInfo
call WriteString
mov edx, OFFSET Prompt1 ;ask for total characters
call WriteString
call ReadInt ;read as integer
mov Nchar, eax
mov edx, OFFSET Prompt2 ;ask for the string of characters
call WriteString
mov edx, OFFSET myarray
mov ecx, NChars
call ReadString
exit
main ENDP
END main
considering using something similar to this to check for vowels in loop as it goes through the array
VowelCheck:
cmp myarray[edi],'a'
je isVowel
cmp myarray[edi],'A'
je isVowel
cmp myarray[edi],'e'
je isVowel
cmp myarray[edi],'E'
je isVowel
cmp myarray[edi],'i'
je isVowel
cmp myarray[edi],'I'
je isVowel
cmp myarray[edi],'o'
je isVowel
cmp myarray[edi],'O'
je isVowel
cmp myarray[edi],'u'
je isVowel
cmp myarray[edi],'U'
je isVowel