diff options
Diffstat (limited to 'mdk-stage1/dietlibc/i386/memcmp.S')
-rw-r--r-- | mdk-stage1/dietlibc/i386/memcmp.S | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/i386/memcmp.S b/mdk-stage1/dietlibc/i386/memcmp.S new file mode 100644 index 000000000..aa6d55f23 --- /dev/null +++ b/mdk-stage1/dietlibc/i386/memcmp.S @@ -0,0 +1,26 @@ +.text +.align 0 +.global memcmp +.type memcmp,@function +memcmp: + xorl %eax,%eax + orl 12(%esp),%eax + jz .Lempty + pushl %esi + pushl %edi + movl 12(%esp),%esi + movl 16(%esp),%edi + movl %eax,%ecx + + rep cmpsb + + decl %esi + decl %edi + lodsb + subb (%edi), %al + movsx %al, %eax + + popl %edi + popl %esi +.Lempty: + ret |