stringss.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 dependent part of strings.pp, not shared with
  6. sysutils unit.
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. function strpas(p : pchar) : string;
  14. {$i strpas.inc}
  15. function strpcopy(d : pchar;const s : string) : pchar;assembler;
  16. asm
  17. pushl %esi // Save ESI
  18. cld
  19. movl s,%esi // Load Source adress
  20. movl d,%edi // load destination address
  21. movzbl (%esi),%ecx // load length in ECX
  22. incl %esi
  23. rep
  24. movsb
  25. movb $0,(%edi)
  26. movl d,%eax // return value to EAX
  27. popl %esi
  28. end ['EDI','EAX','ECX'];
  29. {
  30. $Log$
  31. Revision 1.7 2002-09-07 16:01:19 peter
  32. * old logs removed and tabs fixed
  33. }