View Single Post
Old Feb 3rd, 2005, 3:32 AM   #17
lostcauz
Hobbyist Programmer
 
Join Date: Nov 2004
Location: 1691 miles East of L.A.
Posts: 159
Rep Power: 4 lostcauz is on a distinguished road
MASM is the Microsoft assembler. http://www.masm32.com/

Concerning [edx+edi], notice before entering the loop I xor'ed some registers with themselves. This sets the register to zero. I also pointed ecx and edx to the beginning of the 2 string arrays. ecx is pointing to the first character of the vowel array or 'a'. edx points to the first character in the other string which is 'c'. So when you first enter the loop, ecx is pointing to the first character (index zero) + esi, which is equal to zero, therefore resulting in the character 'a'. Since edi is also zero the same is true for edx. It points to the first character, 'c'.

After passing through the loop notice esi is incremented until the end of the vowel string. Now we are able to move to the next character in our other string. After incrementing edi the statement [edx+edi] may be broken down to [beginning of array + 1] which of course is 'o'. esi is reset to zero and we loop through the vowels once more. Since 'o' is a vowel, the vowel counting variable will be incremented. In this case I used ebx.
__________________
-- lostcauz

Stepped in what?...
Behind whose barn?...
I didn't even know they had a cow!
lostcauz is offline   Reply With Quote