fastest way to reverse string . but reverse only the current line

for example you have a string

the reverse will be

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?
Posted on 2002-03-02 07:55:02 by eko
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.
Posted on 2002-03-02 08:08:04 by Maverick
Posted on 2002-03-02 10:15:57 by stryker
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...
Posted on 2002-03-02 10:48:24 by bitRAKE