hiii

yeah i know there were alot of theards about this subject

but still i have a problem with my own algorithm

xor ebx,ebx
ecx - holds the len(Buffer)

lea esi,
@Loop:
mov dl,
mov dh,
mov ,dl
mov ,dh
inc ebx
dec ecx
cmp ebx,ecx
jb @Loop

the algorthim is work ok . ( i never check his speed) . but my problem when i revrese a text it revereses the 13 or /and the 10 bytes for an example :

1234
1234
wil be something like 43214321 .
does any one have soultion for it ? how can i prevent from this to happen?

bye

eko
Posted on 2001-10-07 10:35:58 by eko
How do you want to do the reversing?


"abcd\n1234" -> "dcba\n4321"
-or- -> "4321\ndcba"


Your first option is easy as you can simply reverse sub-sections of your string, and you will be ok.

Second option will require comparisions of the bytes within your loop, and a more complex method of dealing with them (as you are no longer copying bytes from position a to len - a it can get quite messy, and I'm to lazy to think about it just now).

Mirno
Posted on 2001-10-08 04:00:21 by Mirno
hii .


thanks for the reply

my goal is to do this
"abcd\n1234" -> "dcba\n4321"

do you have any ideas ? - how can i fix my algorithm?



bye
eko
Posted on 2001-10-08 19:17:58 by eko