strlen.inc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. var
  13. saveedi : longint;
  14. asm
  15. movl %edi,saveedi
  16. {$ifdef REGCALL}
  17. movl %eax,%edi
  18. {$else}
  19. movl p,%edi
  20. {$endif}
  21. movl $0xffffffff,%ecx
  22. xorl %eax,%eax
  23. cld
  24. repne
  25. scasb
  26. movl $0xfffffffe,%eax
  27. subl %ecx,%eax
  28. movl saveedi,%edi
  29. end;
  30. {
  31. $Log$
  32. Revision 1.5 2003-11-11 21:08:17 peter
  33. * REGCALL define added
  34. Revision 1.4 2003/09/08 18:21:37 peter
  35. * save edi,esi,ebx
  36. Revision 1.3 2002/09/07 16:01:19 peter
  37. * old logs removed and tabs fixed
  38. }