strlen.inc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team
  5. Processor specific implementation of strlen
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. asm
  13. movl p,%edi
  14. movl $0xffffffff,%ecx
  15. xorl %eax,%eax
  16. cld
  17. repne
  18. scasb
  19. movl $0xfffffffe,%eax
  20. subl %ecx,%eax
  21. end ['EDI','ECX','EAX'];
  22. {
  23. $Log$
  24. Revision 1.2 2001-03-05 17:10:04 jonas
  25. * moved implementations of strlen and strpas to separate include files
  26. (they were duplicated in i386.inc and strings.inc/stringss.inc)
  27. * strpas supports 'nil' pchars again (returns an empty string)
  28. (both merged)
  29. Revision 1.1.2.1 2001/03/05 16:56:01 jonas
  30. * moved implementations of strlen and strpas to separate include files
  31. (they were duplicated in i386.inc and strings.inc/stringss.inc)
  32. * strpas supports 'nil' pchars again (returns an empty string)
  33. }