News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Strings?

Started by 2-Bit Chip, November 17, 2009, 03:11:36 AM

Previous topic - Next topic

hutch--

Rui,


    mov eax, -1
    mov esi, 1


The "mov eax, -1" could be slightly shorter wit "or eax, -1" but it hardly matters.

Preseting EAX with -1 and putting the ADD EAX before the byte copy means you don't have to correct the result on exit from the loop.

Using ESI to store 1 allows you to do the ADD on a register to register which is faster on some hardware than using an immediate. "add eax, esi"
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php