hi
fastest way to reverse string . but reverse only the current line
for example you have a string
"1234"
"abcd"
"0987"
the reverse will be
"4321"
"dcba"
"7890"
i think you need to scan for 13 or for the null (new line 13,10 , just add 1 for 10) . and reverse it according the "new len" you have found .
any one has better idea?
fastest way to reverse string . but reverse only the current line
for example you have a string
"1234"
"abcd"
"0987"
the reverse will be
"4321"
"dcba"
"7890"
i think you need to scan for 13 or for the null (new line 13,10 , just add 1 for 10) . and reverse it according the "new len" you have found .
any one has better idea?
Yup, find the start and the length of the string, then use BSWAP to quickly reverse the string. In the 2nd phase the string will already be cached, most probably.
Look down for my thread:
http://www.asmcommunity.net/board/index.php?topic=3416&highlight=string+reverse
:)
http://www.asmcommunity.net/board/index.php?topic=3416&highlight=string+reverse
:)
esi - string pointer
edi - string end pointer - 4
@@:
mov eax, [esi]
mov edx, [edi]
add esi, 4
sub edi, 4
bswap eax
bswap edx
mov [edi + 4], eax
mov [esi - 4], edx
cmp edi, esi
jge @B
Sorry, I only had a couple minutes...