TITLE Copying a String Backwards (CopyStr.asm)
; This program copies a string backwards.
source BYTE "This is the source string",0
target BYTE SIZEOF source DUP('#')
mov esi,0 ; index register
mov ecx,SIZEOF source ; loop counter
mov al,source[ecx-1] ; get a character from source
mov target[esi],al ; store it in the target
inc esi ; move to next character
loop L1 ; repeat for entire string
mov esi,OFFSET target
mov ecx,SIZEOF target
I know my code reveres the string correctly because I look at the memory in debug mode, but when I DumpMem I get an answer that is off by one spot. I get the following:
I cant figure out why I have the extra 00 can someone please help?
1 Year Ago
Related Article:Problem in TSR (Assembly)
is a Assembly discussion thread by Daysonn that has 4 replies, was last updated 1 year ago and has been tagged with the keywords: assembly, problem, program, tsr.