Hello, I'm learning mASM and I was wondering if someone could help me out. I'm trying to figure out how to get whats left of a string.. for example..
In visual basic it would be:
str = Left("Hello123",5)
and str would equal "Hello" without the 123..
How would I do that in mASM? Thanks! :cool:
In visual basic it would be:
str = Left("Hello123",5)
and str would equal "Hello" without the 123..
How would I do that in mASM? Thanks! :cool:
Isnt there a function for that in the MASM32 library?
Which function
Which function
RTFM :P
Look in the Masm32.lib help file... I think its called szLeft
i have masm8 and the masm32.lib isnt included.. where can i download it
if it hasn't been made for you look in the masm32 sub- sub- folder for a batch file that will create it :)
you have all source code you need
a lib is just a container of said compiled code.
you have all source code you need
a lib is just a container of said compiled code.
\masm32\m32lib\make.bat
Where can i get the sources of all this libraries ??
in that folder
you could always use the not so fast win api function lstrcpyn to do a left operation like you want...
you could also do the superfast way of just placing a null character in the string at the position you want the string to end... you will destroy the original string however...
remember, a string is nothing more than an array of byte sized numbers whose values are interpreted as characters
.data
szHello123 db "Hello123", 0
str db 10 dup(?)
.code
invoke lstrcpyn, addr str, addr szHello123, 5
you could also do the superfast way of just placing a null character in the string at the position you want the string to end... you will destroy the original string however...
mov szHello123[5], 0
remember, a string is nothing more than an array of byte sized numbers whose values are interpreted as characters
mov ecx,5
lea esi, stringsource
lea edi, stringdest
rep movsb
Easy code...
Just make sure that stringdest is filled up with 0.