/ strcmp.s (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes

        .globl _strcmp

/ int strcmp (const char *string1, const char *string2)
/ {
/   int d;
/   
/   for (;;)
/     {
/       d = (int)(unsigned char)*string1 - (int)(unsigned char)*string2;
/       if (d != 0 || *string1 == 0 || *string2 == 0)
/         return (d);
/       ++string1; ++string2;
/     }
/ }

/ assumes ds=es!

        .text

        .align  2, 0x90

_strcmp:
        pushl   %esi
        pushl   %edi
        movl    3*4(%esp), %esi         / string1
        movl    4*4(%esp), %edi         / string2
        xorl    %eax, %eax
        .align  2, 0x90
1:      lodsb
        scasb
        jne     2f
        orb     %al, %al
        jne     1b
        popl    %edi
        popl    %esi
        ret

        .align  2, 0x90
2:      movzbl  -1(%edi), %ecx
        subl    %ecx, %eax
        popl    %edi
        popl    %esi
        ret
