Results 1 to 5 of 5

Thread: string manipulation

  1. #1

    Thread Starter
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    string manipulation

    is there any equivalent functions in assembly like the vb mid() left() split() etc etc?
    Chris

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: string manipulation

    There are no library functions in assembly

    If you're using MASM there might be macros for it.

  3. #3
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: string manipulation

    Hutch's MASM package i think includes some similar functions - but you have to include them into your program. Check the m32lib directory in the MASM package. - Yeah its there - SZLEFT.asm, SZMID.asm etc. then you just include them in your program.
    However, these were written for compatibility and some i believe quite some time ago - so they are not fully inefficient

  4. #4

    Thread Starter
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: string manipulation

    thanks I found the SZLEFT.asm, im trying to include it in the program, im not actually trying to call the proc yet, only including it, heres my code:

    Code:
    .486
    .model flat,stdcall
    option casemap:none
    
    include \masm32\include\windows.inc
    include \masm32\include\user32.inc
    includelib \masm32\lib\user32.lib            ; calls to functions
    include \masm32\include\kernel32.inc
    includelib \masm32\lib\kernel32.lib
    
    ;left function !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    include \masm32\m32lib\SZLEFT.asm
    
    .DATA
    
    Message db "This is the message",0
    Caption db "This is the Caption",0
    
    .CODE
    
    start:
    
    invoke MessageBox, NULL, addr Message, addr Caption, MB_OK
    invoke ExitProcess, NULL
    
    end start
    it just says 'make errors occured' btw that is the correct path to the file

    BTW this is MASM

    also...
    could someone give an example of how to call it with an if statement so the pseudo code would be:

    Code:
    if left(addr Message, 3) == "abc"
         ;the first 3 chars are abc
    else
        ;the first 3 chars are not abc
    end if
    thanks
    Chris

  5. #5
    Addicted Member
    Join Date
    Aug 2005
    Location
    York
    Posts
    197

    Re: string manipulation

    ummmmm...... i don't use masm....but I'll have a look sometime
    Cheers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width