update for HEAD-2003091401
[reactos.git] / lib / string / i386 / tcsnlen.h
diff --git a/lib/string/i386/tcsnlen.h b/lib/string/i386/tcsnlen.h
new file mode 100644 (file)
index 0000000..90a4ec6
--- /dev/null
@@ -0,0 +1,30 @@
+/* $Id$
+*/
+
+#include "tchar.h"
+
+.globl _tcsnlen
+
+_tcsnlen:
+ push  %edi
+ mov   0x8(%esp), %edi
+ mov   0xC(%esp), %ecx
+ xor   %eax, %eax
+ test  %ecx, %ecx
+ jz    .L1
+ mov   %ecx, %edx
+
+ cld
+
+ repne _tscas
+
+ sete  %al
+ sub   %ecx, %edx
+ sub   %eax, %edx
+ mov   %edx, %eax
+
+.L1:
+ pop   %edi
+ ret
+
+/* EOF */