mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 22:01:43 +00:00
Add .gitattributes and .gitignore files and normalize line endings in the repository (#10)
This commit is contained in:
parent
c609406c2f
commit
9ebf43567d
309 changed files with 66975 additions and 66873 deletions
|
@ -1,45 +1,45 @@
|
|||
|
||||
#include "tchar.h"
|
||||
#include <asm.inc>
|
||||
|
||||
PUBLIC _tcslen
|
||||
.code
|
||||
|
||||
FUNC _tcslen
|
||||
FPO 0, 1, 1, 1, 0, FRAME_FPO
|
||||
|
||||
/* Save edi and eflags (according to the x86 ABI, we don't need to do that
|
||||
but since the native function doesn't change the direction flag, we don't
|
||||
either */
|
||||
push edi
|
||||
pushfd
|
||||
|
||||
/* Load the string pointer into edi */
|
||||
mov edi, [esp + 12]
|
||||
|
||||
/* Set eax to 0, since we want to compare with 0 */
|
||||
xor eax, eax
|
||||
|
||||
/* Set ecx to -1 (i.e. 0xFFFFFFFF) */
|
||||
mov ecx, -1
|
||||
|
||||
/* Clear direction flag */
|
||||
cld
|
||||
|
||||
/* Now compare the characters until a 0 is found */
|
||||
repne _tscas
|
||||
|
||||
/* Calculate the count. For n characters, we do (n + 1) comparisons. Initial
|
||||
value of ecx was -1, so end value of ecx is (-1 - (n + 1)) = -(n + 2).
|
||||
=> n = -ecx - 2 = ~ecx - 1 */
|
||||
not ecx
|
||||
lea eax, [ecx - 1]
|
||||
|
||||
/* Restore eflags/edi and return the result */
|
||||
popfd
|
||||
pop edi
|
||||
ret
|
||||
ENDFUNC
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
||||
#include "tchar.h"
|
||||
#include <asm.inc>
|
||||
|
||||
PUBLIC _tcslen
|
||||
.code
|
||||
|
||||
FUNC _tcslen
|
||||
FPO 0, 1, 1, 1, 0, FRAME_FPO
|
||||
|
||||
/* Save edi and eflags (according to the x86 ABI, we don't need to do that
|
||||
but since the native function doesn't change the direction flag, we don't
|
||||
either */
|
||||
push edi
|
||||
pushfd
|
||||
|
||||
/* Load the string pointer into edi */
|
||||
mov edi, [esp + 12]
|
||||
|
||||
/* Set eax to 0, since we want to compare with 0 */
|
||||
xor eax, eax
|
||||
|
||||
/* Set ecx to -1 (i.e. 0xFFFFFFFF) */
|
||||
mov ecx, -1
|
||||
|
||||
/* Clear direction flag */
|
||||
cld
|
||||
|
||||
/* Now compare the characters until a 0 is found */
|
||||
repne _tscas
|
||||
|
||||
/* Calculate the count. For n characters, we do (n + 1) comparisons. Initial
|
||||
value of ecx was -1, so end value of ecx is (-1 - (n + 1)) = -(n + 2).
|
||||
=> n = -ecx - 2 = ~ecx - 1 */
|
||||
not ecx
|
||||
lea eax, [ecx - 1]
|
||||
|
||||
/* Restore eflags/edi and return the result */
|
||||
popfd
|
||||
pop edi
|
||||
ret
|
||||
ENDFUNC
|
||||
|
||||
END
|
||||
/* EOF */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue