News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

String funtion szCmpi and Cmpi

Started by ale7712molon, June 04, 2012, 01:20:18 PM

Previous topic - Next topic

ale7712molon

thank for u time

I need an example of using the String function szCmpi and Cmpi, i need to know the sintaxis

i dont know  where  store the return value

please help me

hutch--

Have a look at the source code, its in the m32 directory and the documentation is in the help file.

dedndave

you don't necessarily need to store the result
it is a zero or non-zero value, indicating whether or not a match was found

ale7712molon

ok thank for u answer, but i need to know about szCmpi,  the source code for this function is located 

masm32\m32lib , i dont know why not because they use a table

jj2007


dedndave

they use a table because it is a case-insensitive comparison of strings

leebar1983

Ok thanks. I was wondering about this myself.

jj2007

Quote from: ale7712molon on June 04, 2012, 01:20:18 PM
I need an example of using the String function szCmpi and Cmpi, i need to know the sintaxis

Syntax is different for the two versions:
invoke szCmp, esi, edi
invoke szCmpi, esi, edi, len(esi)


Here is a test piece with timings.
StringsDiffer:  different at pos 98 (case-sensitive, zero-based)
StringsDiffer:  different at pos 99 (case-insensitive)
szCmp:          different (position not returned)
szCmpi:         different at pos 100 (case-sensitive, one-based)

AMD Athlon(tm) Dual Core Processor 4450B (SSE3)
105     cycles for StringsDiffer, case-sensitive
113     cycles for StringsDiffer, case-insensitive
255     cycles for szCmp
670     cycles for szCmpi, MasmBasic Len
774     cycles for szCmpi, Masm32 len

104     cycles for StringsDiffer, case-sensitive
113     cycles for StringsDiffer, case-insensitive
249     cycles for szCmp
685     cycles for szCmpi, MasmBasic Len
774     cycles for szCmpi, Masm32 len