hello
I have an array of dwords wich are the addresses of strings the first one is stored in eax I am tying to go though the list untill the correct one is found, the meathod I'm using odsn't seam to be working what is the best meathod that would be used to do this. below is the code I'm using

.while NamesLeft!=0
mov esi,
push esi
push edi
repz cmpsb
pop edi
pop esi
je foundit
dec
add eax, 4
.endw
Posted on 2001-12-16 07:34:38 by James
your code cannot work. Before each cmpsb ecx should be set to the length of the string and after the cmpsb ecx should be 0 (or so :) ).

japheth
Posted on 2001-12-16 09:44:39 by japheth
Hi James,

I haven't tried this but it should work:

xor edx,edx ;offset into MyString
@@:
mov edi,OFFSET MyString+edx
mov ecx,-1
xor eax,eax
repne scasb
not ecx ;ecx now has string length

mov edi,OFFSET MyString+edx
repe cmpsb
or ecx,00h ;if ecx 0, then strings match
jz @StringMatch
add edx,04
jmp @b

best regards,

czDrillard
Posted on 2001-12-16 12:41:55 by czDrillard