stringss.inc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. {$define FPC_UNIT_HAS_STRPAS}
  14. function strpas(p : pchar) : string;
  15. {$i strpas.inc}
  16. {$define FPC_UNIT_HAS_STRPCOPY}
  17. function strpcopy(d : pchar;const s : string) : pchar;assembler;
  18. var
  19. saveesi,saveedi : longint;
  20. asm
  21. movl %edi,saveedi
  22. movl %esi,saveesi
  23. cld
  24. movl s,%esi // Load Source adress
  25. movl d,%edi // load destination address
  26. movzbl (%esi),%ecx // load length in ECX
  27. incl %esi
  28. rep
  29. movsb
  30. movb $0,(%edi)
  31. movl d,%eax // return value to EAX
  32. movl saveedi,%edi
  33. movl saveesi,%esi
  34. end;
  35. {
  36. $Log$
  37. Revision 1.9 2003-09-08 18:21:37 peter
  38. * save edi,esi,ebx
  39. Revision 1.8 2003/07/07 20:22:05 peter
  40. * generic string routines added
  41. Revision 1.7 2002/09/07 16:01:19 peter
  42. * old logs removed and tabs fixed
  43. }