stringss.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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; assembler;
  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. {$ifdef REGCALL}
  25. movl %eax,%edi // load destination address
  26. movl %edx,%esi // Load Source adress
  27. {$else}
  28. movl s,%esi // Load Source adress
  29. movl d,%edi // load destination address
  30. {$endif}
  31. movzbl (%esi),%ecx // load length in ECX
  32. incl %esi
  33. rep
  34. movsb
  35. movb $0,(%edi)
  36. {$ifndef REGCALL}
  37. movl d,%eax // return value to EAX
  38. {$endif}
  39. movl saveedi,%edi
  40. movl saveesi,%esi
  41. end;
  42. {
  43. $Log$
  44. Revision 1.11 2003-11-19 16:58:44 peter
  45. * make strpas assembler function
  46. Revision 1.10 2003/11/11 21:08:17 peter
  47. * REGCALL define added
  48. Revision 1.9 2003/09/08 18:21:37 peter
  49. * save edi,esi,ebx
  50. Revision 1.8 2003/07/07 20:22:05 peter
  51. * generic string routines added
  52. Revision 1.7 2002/09/07 16:01:19 peter
  53. * old logs removed and tabs fixed
  54. }