I have got this so far:
mov esi,0
mov edi,LENGTHOF source - 2
mov ecx,SIZEOF source
L1:;iterate a loop
mov al,source[esi]
mov target[edi],al
inc esi
dec edi
loop L1
From next data
source BYTE "This is the source string",0
BYTE 4 DUP('%')
target BYTE SIZEOF source DUP('#')
BYTE 4 DUP('^')
I got this output:
gnirts ecruos eht si sihT#^^^^
The target string should not have those characters at the end. I think I need to find the byte that needs to be zero and set it. How do I do that?