Hello, a very basic question *g* I have 3 Strings and like to add them to one result. like: 1 db 'hello',0 2 db 'world',0 3 db '!',0 now i like to know how to get the result looking like : hello world ! i look on some sources but i dont understand how : 'mov' and 'add' works Thanks for any help ;)
Posted on 2001-02-21 10:16:00 by WH¥
lstrcat will add strings together, but if you don't know what mov and add do then I'd *seriously* read a few books and basic tutorials. You have to crawl before you can walk umbongo
Posted on 2001-02-21 10:51:00 by umbongo
As we're working with a 32bit processor, mov is designed to 'move' either 8, 16, or 32 bit data. As a string is some arbitrary length piece of data, a processor cannot simply "pick up and drop" that data! Instead you must get the data in small chunks. If you know your string is a multiple of 4 bytes, 32bit mov's are better (more efficient), otherwise you must devise some other method. This may even be something such as:

    mov esi, source
    mov edi, dest
    mov al,  ;Get a character from our string
    mov , al ;Drop the character in the destination
    inc esi
    inc edi
    or al, al
    jnz @B        ;If not the end of the string loop again
As you can see, this mov's 8bit data, ensuring no extra data passed the null terminator is mov'ed about. It essentially copys one character at a time! However moving 4 characters at a time is (obviously) 4 times faster (if you can do it). As for add, this is simple 8, 16, or 32bit integer arithmetic! But as Umbongo said, these are the most basic instructions in assembly, and should be understood before you try dealing with more complex functions (as these functions will more often than not use these instructions). Mirno
Posted on 2001-02-21 11:06:00 by Mirno
Hello, thanks to you two for the help ;) im trying to learn asm since 5 weeks,so im just crawling around *g* also i only found 1 page who has some tutorials in my homelanguage :( but im very happy to know this message board ! happy coding and thx for helping ;)
Posted on 2001-02-21 14:59:00 by WH¥