How do I remove everything in the string after the '?' ? The code I have so far searches for the '?'. How do I proceed from there?
This is my code.
INCLUDE Irvine32.inc
.data
source BYTE "Is this a string? Enter y for yes, and n for no",0
.code
main PROC
mov edi, OFFSET source
mov al, '?' ; search for ?
mov ecx, LENGTHOF source
cld
repne scasb ; repeat while not equal
jnz quit
dec edi ; edi points to ?
end main
You can replace everything after the "?" by zeroes, so all the characters after "?" are been "removed" :
Notice how we are using the values that EDI and ECX have after searching for "?".