Convert library asm files to GAS syntax

This commit is contained in:
Arun Thomas
2010-03-03 14:27:30 +00:00
parent bf7397b64e
commit cbd276e4ce
302 changed files with 2544 additions and 2451 deletions
+28
View File
@@ -0,0 +1,28 @@
/* _strnlen() Author: Kees J. Bot */
/* 1 Jan 1994 */
/* size_t _strnlen(const char *s, size_t ecx) */
/* Return the length of a string. */
/* */
.text
.globl __strnlen
.balign 16
__strnlen:
push %ebp
movl %esp, %ebp
push %edi
movl 8(%ebp), %edi /* edi = string */
xorb %al, %al /* Look for a zero byte */
movl %ecx, %edx /* Save maximum count */
cmpb $1, %cl /* 'Z' bit must be clear if ecx = 0 */
cld
repne scasb /* Look for zero */
jne no0
incl %ecx /* Don't count zero byte */
no0:
movl %edx, %eax
subl %ecx, %eax /* Compute bytes scanned */
pop %edi
pop %ebp
ret