strlen.inc 876 B

1234567891011121314151617181920212223242526272829303132333435
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by the Free Pascal development team
  4. Processor specific implementation of strlen
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. var
  12. saveedi : longint;
  13. asm
  14. movl %edi,saveedi
  15. {$ifdef REGCALL}
  16. movl %eax,%edi
  17. {$else}
  18. movl p,%edi
  19. {$endif}
  20. movl $0xffffffff,%ecx
  21. xorl %eax,%eax
  22. cld
  23. repne
  24. scasb
  25. movl $0xfffffffe,%eax
  26. subl %ecx,%eax
  27. movl saveedi,%edi
  28. end;