GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


strcmp x86 inline by DELTRON
// Compare two strings, inline x86 assembly - DELTRON 6/23/2004

void main (void)
{
    char string1[]= {"Hello there"};
    char string2[]= {"Hello jerky"};

    int len = sizeof(string1);

    // assuming strings are same length

    __asm
    {
        mov  ecx,len
        cld
        lea  esi, string1
        lea  edi, string2
        repe cmpsb
        jne  notequ
        nop
notequ: nop

    }

    return;
}