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:: No Line Numbers


strcmp x86 inline by DELTRON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 
// 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;
}