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:
Posted on 2003-03-20 12:34:35 by athl33t
Isnt there a function for that in the MASM32 library?
Posted on 2003-03-20 12:40:53 by bazik
Which function
Posted on 2003-03-20 12:45:53 by athl33t

Which function


Look in the Masm32.lib help file... I think its called szLeft
Posted on 2003-03-20 12:51:10 by bazik
i have masm8 and the masm32.lib isnt included.. where can i download it
Posted on 2003-03-20 13:12:48 by athl33t
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.
Posted on 2003-03-20 13:16:07 by Hiroshimator
Posted on 2003-03-20 13:17:05 by Hiroshimator
Where can i get the sources of all this libraries ??
Posted on 2003-03-20 13:22:01 by AceEmbler
in that folder
Posted on 2003-03-20 13:24:42 by Hiroshimator
you could always use the not so fast win api function lstrcpyn to do a left operation like you want...


szHello123 db "Hello123", 0
str db 10 dup(?)

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
Posted on 2003-03-20 15:39:35 by BubbaFate

mov ecx,5
lea esi, stringsource
lea edi, stringdest
rep movsb

Easy code...
Just make sure that stringdest is filled up with 0.
Posted on 2003-03-21 06:24:49 by roticv