I'm using MASM and I'm trying to exchange a string with another
I want to change test
with rull
I'm using an array of string: This is a test
I'm trying to search for test
and replace it with rull
.
I did everything, however, I have 2 problems
- I have to write
rull
in reverse,llur
. - It prints
t
withrull
, so the output after replacing it will betrull
. I am not sure where did thet
comes.
Can someone help?
This is what I've done so far:
cld lea edi, str2 mov ecx, lengthof str2 mov eax, 'test' repne scasb je found jne notfound dec edi call crlf found: mov eax, 'llur' stosd lea edi, str2 L1: mov eax, [edi] call writechar add edi, type str2 loop l1