Would there be any macros for this?
there are quite a few macros for strings in the masm32 package
see the help file named "masm32\help\hlhelp.chm" - look under "macro catagories" - "string macros"
Quote from: dedndave on August 20, 2009, 12:49:04 AM
there are quite a few macros for strings in the masm32 package
see the help file named "masm32\help\hlhelp.chm" - look under "macro catagories" - "string macros"
None for splitting a string. ::)
well - i think left$ and right$ might be useful
i sometimes use them with uhex$ because uhex$ only accepts a dword register and i may want a byte or word
print right$(uhex$(eax),4)
that essentially takes the right-hand 4 characters of the uhex$ string and makes a new string out of it
i could use them together
print left$(right$(uhex$(eax),4),2)
that would show me the hex value of AH
someString db 'hello world',0
right$(left$(ADDR someString,5),1)
that would return the address of a new string in eax = "o",0
2 bit,
Depends of what you want to split and by what criterion. Tell us what you are trying to do and we may be able to help you.
Split a string in half.
hello, there
I will not know how long the first section (before comma) will be.
Its probably a very simple algo you need, read everything up to the ",", place it in one buffer, read everything up to the end of the string AFTER the "," into a second buffer. If you can modify the original, overwrite the first "," with a zero. Use the original address for the first then use the address of the character following the "," as the second address.
That is probably the fastest way to do it.
Alright, thank you hutch.